mirror of
https://github.com/alexjustesen/speedtest-tracker.git
synced 2026-06-23 07:30:09 +00:00
31 lines
675 B
PHP
31 lines
675 B
PHP
<?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());
|
|
});
|