Update (kernel)

This commit is contained in:
2023-11-20 01:48:47 +08:00
parent 25cb909a3a
commit e2b2bd63da

View File

@@ -24,7 +24,12 @@ protected function schedule(Schedule $schedule): void
$schedule->call(function () {
$future_post = Post::whereNotNull('published_at')->where('status', 'future')->where('published_at', '>=', now())->orderBy('published_at', 'ASC')->first();
PublishIndexPostJob::dispatch($future_post->id)->onQueue('default')->onConnection('default');
if (!is_null($future_post))
{
PublishIndexPostJob::dispatch($future_post->id)->onQueue('default')->onConnection('default');
}
})->everyMinute();