forked from alexjustesen/speedtest-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconsole.php
More file actions
41 lines (36 loc) · 916 Bytes
/
Copy pathconsole.php
File metadata and controls
41 lines (36 loc) · 916 Bytes
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
<?php
use App\Actions\CheckForScheduledSpeedtests;
use App\Actions\VacuumDatabase;
use Illuminate\Support\Facades\Schedule;
/**
* Checks if Result model records should be pruned.
*/
Schedule::command('model:prune')
->daily()
->when(function () {
return config('speedtest.prune_results_older_than') > 0;
});
/**
* Nightly maintenance
*/
Schedule::daily()
->group(function () {
Schedule::command('queue:prune-batches --hours=48');
Schedule::command('queue:prune-failed --hours=48');
});
/**
* Check for scheduled speedtests.
*/
Schedule::everyMinute()
->group(function () {
Schedule::call(fn () => CheckForScheduledSpeedtests::run());
});
/**
* Weekly SQLite maintenance (no-op on other drivers).
*/
Schedule::call(fn () => VacuumDatabase::run())
->weekly()
->sundays()
->at('03:15')
->name('sqlite-vacuum')
->onOneServer();