From 92bfa5df84c2e7a4687074d4f3ece4911ecb5d51 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Sat, 23 Mar 2024 05:19:15 +0800 Subject: [PATCH] improve cleanup schedule --- app/Console/Commands/Test.php | 4 ++-- app/Console/Kernel.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Console/Commands/Test.php b/app/Console/Commands/Test.php index 9da9fd06..780a82c4 100644 --- a/app/Console/Commands/Test.php +++ b/app/Console/Commands/Test.php @@ -98,8 +98,8 @@ class Test extends Command */ public function handle() { - $str = "abc"; - $diff = strstr($str, ",", true); + $interval = 100; + $diff = sprintf("*/%d * * * *", ceil($interval/60)); dd($diff); } diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index f13c9938..d7db3ca9 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -61,7 +61,7 @@ class Kernel extends ConsoleKernel $interval = 7200; } $schedule->job(new CheckCleanup()) - ->cron(sprintf("*/%d * * * *", intval($interval/60))) + ->cron(sprintf("*/%d * * * *", ceil($interval/60))) ->withoutOverlapping(); } }