Update (Task)
This commit is contained in:
@@ -22,7 +22,7 @@ protected function schedule(Schedule $schedule): void
|
|||||||
})->everySixHours()->name('write-a-job-6hrs');
|
})->everySixHours()->name('write-a-job-6hrs');
|
||||||
|
|
||||||
$schedule->call(function () {
|
$schedule->call(function () {
|
||||||
$future_post = Post::whereNotNull('published_at')->where('status', 'future')->where('published_at', '>=', now())->orderBy('published_at', 'ASC')->first();
|
$future_post = Post::whereNotNull('published_at')->where('status', 'future')->where('published_at', '<=', now())->orderBy('published_at', 'ASC')->first();
|
||||||
|
|
||||||
if (! is_null($future_post)) {
|
if (! is_null($future_post)) {
|
||||||
PublishIndexPostJob::dispatch($future_post->id)->onQueue('default')->onConnection('default');
|
PublishIndexPostJob::dispatch($future_post->id)->onQueue('default')->onConnection('default');
|
||||||
|
|||||||
Reference in New Issue
Block a user