feat: clean reset tokens daily
This commit is contained in:
parent
8e5a50dd2b
commit
55215b2c36
|
|
@ -9,6 +9,14 @@ Artisan::command('inspire', function () {
|
||||||
})->purpose('Display an inspiring quote');
|
})->purpose('Display an inspiring quote');
|
||||||
|
|
||||||
Schedule::command('horizon:snapshot')->everyFiveMinutes();
|
Schedule::command('horizon:snapshot')->everyFiveMinutes();
|
||||||
|
Schedule::command('sanctum:prune-expired --hours=24')
|
||||||
|
->daily()
|
||||||
|
->withoutOverlapping()
|
||||||
|
->onOneServer();
|
||||||
|
Schedule::command('auth:clear-resets')
|
||||||
|
->daily()
|
||||||
|
->withoutOverlapping()
|
||||||
|
->onOneServer();
|
||||||
Schedule::command('meal-posts:generate-ai')
|
Schedule::command('meal-posts:generate-ai')
|
||||||
->daily()
|
->daily()
|
||||||
->withoutOverlapping(55)
|
->withoutOverlapping(55)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Artisan;
|
||||||
|
|
||||||
|
it('schedules expired auth token cleanup commands', function () {
|
||||||
|
Artisan::call('schedule:list', [
|
||||||
|
'--json' => true,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$tasks = json_decode(Artisan::output(), true, flags: JSON_THROW_ON_ERROR);
|
||||||
|
$commands = collect($tasks)->pluck('command');
|
||||||
|
|
||||||
|
expect($commands)
|
||||||
|
->toContain('php artisan sanctum:prune-expired --hours=24')
|
||||||
|
->toContain('php artisan auth:clear-resets');
|
||||||
|
});
|
||||||
Loading…
Reference in New Issue