info('[SyncChatbotLogsJob] Execution started at: ' . now()); // ✅ Dispatch SyncChatbotLogsJob every 5 minutes to the correct queue $schedule->call(function () { dispatch(new SyncChatbotLogsJob()) ->onQueue('chatbot_logs') // 👈 Ensure it goes to the right queue ->delay(now()->addSeconds(5)); }) ->everyFiveMinutes() ->withoutOverlapping() ->sendOutputTo(storage_path('logs/chatbot_log_sync.log')) ->onFailure(function () { \Log::error('❌ SyncChatbotLogsJob failed.'); }) ->onSuccess(function () { \Log::info('✅ SyncChatbotLogsJob completed successfully.'); }); // ✅ Dispatch SyncConversations every 10 minutes to the correct queue $schedule->call(function () { dispatch(new SyncConversations()) ->onQueue('sync_conversations') // 👈 Queue name specified ->delay(now()->addSeconds(5)); }) ->everyTenMinutes() ->withoutOverlapping() ->sendOutputTo(storage_path('logs/sync_conversations.log')) ->onFailure(function () { \Log::error('❌ SyncConversations job failed.'); }) ->onSuccess(function () { // \Log::info('✅ SyncConversations job completed successfully.'); Log::channel('chatbot')->info('yncConversations job completed successfully.'); }); } /** * Register the commands for the application. */ protected function commands(): void { $this->load(__DIR__.'/Commands'); require base_path('routes/console.php'); } protected $commands = [ \App\Console\Commands\ServeWithCustomPort::class, ]; }