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
30 lines (26 loc) · 675 Bytes
/
console.php
File metadata and controls
30 lines (26 loc) · 675 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
<?php
use App\Actions\CheckForScheduledSpeedtests;
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());
});