Recently, I used Laravel to do scheduled tasks. I wrote a scheduled task that can be executed normally every minute. However, when it is changed to hours, it cannot be executed as expected. It made me confused.
protected function schedule(Schedule $schedule)
{
$schedule->call(function () {
//DB::table('cms_articles')->delete();
DB::update('update cms_articles set hit=hit + FLOOR(1 + (RAND() * 10)) where hit>1000');
DB::update('update cms_articles set hit=hit + FLOOR(1 + (RAND() * 20)) where hit<1000');
})->hourly();
}