From: Daniel Karbach Date: Thu, 28 Mar 2024 10:03:41 +0000 (+0100) Subject: clean up forgotten guessing games X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=6977dce178bc418e365b4a013d5798ac8e9e1595;p=alttp.git clean up forgotten guessing games --- diff --git a/app/Console/Commands/GuessingClean.php b/app/Console/Commands/GuessingClean.php new file mode 100644 index 0000000..d26b3e9 --- /dev/null +++ b/app/Console/Commands/GuessingClean.php @@ -0,0 +1,47 @@ +where('guessing_start', '<', now() + ->sub(4, 'hour')) + ->get(); + foreach ($channels as $channel) { + $this->line($channel->title); + $channel->guessing_start = null; + $channel->guessing_end = null; + $channel->save(); + } + return Command::SUCCESS; + } + +} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index bbb747d..32e5c8a 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -22,6 +22,7 @@ class Kernel extends ConsoleKernel $schedule->command('sync:avatars')->everyFiveMinutes(); $schedule->command('sync:racetime')->everyFiveMinutes(); $schedule->command('chat:evaluate 100')->everyMinute(); + $schedule->command('guessing:clean')->everyFifteenMinutes(); } /**