forked from alexjustesen/speedtest-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSystemMaintenance.php
More file actions
48 lines (39 loc) · 1.04 KB
/
SystemMaintenance.php
File metadata and controls
48 lines (39 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Log;
class SystemMaintenance extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'app:system-maintenance';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Functions to keep Speedtest Tracker nice and healthy.';
/**
* Execute the console command.
*/
public function handle()
{
try {
Artisan::call('cache:clear');
} catch (\Throwable $th) {
Log::info('System maintenance failed to clear the cache.');
return Command::FAILURE;
}
try {
Artisan::call('view:clear');
} catch (\Throwable $th) {
Log::info('System maintenance failed to clear the view cache.');
return Command::FAILURE;
}
return Command::SUCCESS;
}
}