This commit is contained in:
2023-11-20 00:32:26 +08:00
parent 9ce3e5c82a
commit 2559d4be1c
37 changed files with 288 additions and 12419 deletions

View File

@@ -4,11 +4,10 @@
use App\Jobs\BrowseAndWriteWithAIJob;
use App\Jobs\PublishIndexPostJob;
use App\Models\Post;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use App\Models\Post;
class Kernel extends ConsoleKernel
{
/**
@@ -22,10 +21,9 @@ protected function schedule(Schedule $schedule): void
})->dailyAt('00:00');
$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');
$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');
})->everyMinute();