Add (news bites)
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
|
||||
namespace App\Console;
|
||||
|
||||
use App\Jobs\BrowseAndWriteWithAIJob;
|
||||
use App\Jobs\BrowseDFSAndWriteWithAIJob;
|
||||
use App\Jobs\BrowseRSSPostJob;
|
||||
use App\Jobs\PublishIndexPostJob;
|
||||
use App\Models\Post;
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
@@ -15,20 +16,24 @@ class Kernel extends ConsoleKernel
|
||||
*/
|
||||
protected function schedule(Schedule $schedule): void
|
||||
{
|
||||
$schedule->command('sitemap:generate')->daily()->name('sitemap-generate-daily');
|
||||
$schedule->command('sitemap:generate')->everySixHours()->name('sitemap-generate-every-six-hours');
|
||||
|
||||
$schedule->call(function () {
|
||||
BrowseAndWriteWithAIJob::dispatch()->onQueue('default')->onConnection('default');
|
||||
})->everySixHours()->name('write-a-job-6hrs');
|
||||
BrowseRSSPostJob::dispatch(1)->onQueue('default')->onConnection('default');
|
||||
})->hourly()->name('browse-rss-post-job-hourly');
|
||||
|
||||
$schedule->call(function () {
|
||||
$future_post = Post::whereNotNull('published_at')->where('status', 'future')->where('published_at', '<=', now())->orderBy('published_at', 'ASC')->first();
|
||||
// $schedule->call(function () {
|
||||
// BrowseDFSAndWriteWithAIJob::dispatch()->onQueue('default')->onConnection('default');
|
||||
// })->everySixHours()->name('write-a-job-6hrs');
|
||||
|
||||
if (! is_null($future_post)) {
|
||||
PublishIndexPostJob::dispatch($future_post->id)->onQueue('default')->onConnection('default');
|
||||
}
|
||||
// $schedule->call(function () {
|
||||
// $future_post = Post::whereNotNull('published_at')->where('status', 'future')->where('published_at', '<=', now())->orderBy('published_at', 'ASC')->first();
|
||||
|
||||
})->everyMinute()->name('schedule-future-post');
|
||||
// if (! is_null($future_post)) {
|
||||
// PublishIndexPostJob::dispatch($future_post->id)->onQueue('default')->onConnection('default');
|
||||
// }
|
||||
|
||||
// })->everyMinute()->name('schedule-future-post');
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user