diff --git a/app/Console/Commands/Database/CleanupLoginKeys.php b/app/Console/Commands/Database/CleanupLoginKeys.php new file mode 100644 index 00000000..9c417acb --- /dev/null +++ b/app/Console/Commands/Database/CleanupLoginKeys.php @@ -0,0 +1,34 @@ +where('created_at', '<', now()->subDays(1)) + ->delete(); + + return Command::SUCCESS; + } +} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index a797c49d..6eb6e1d7 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -2,6 +2,7 @@ namespace App\Console; +use App\Console\Commands\Database\CleanupLoginKeys; use App\Console\Commands\Feed\ReadAndSyncPodcastFeeds; use App\Console\Commands\OpenBooks\SyncOpenBooks; use Illuminate\Console\Scheduling\Schedule; @@ -24,12 +25,15 @@ class Kernel extends ConsoleKernel */ protected function schedule(Schedule $schedule) { + $schedule->call(new PruneStaleAttachments) ->daily(); $schedule->command(SyncOpenBooks::class) ->dailyAt('04:00'); $schedule->command(ReadAndSyncPodcastFeeds::class) ->dailyAt('04:30'); + $schedule->command(CleanupLoginKeys::class) + ->everyFifteenMinutes(); } /**