File manager - Edit - /home/autoph/public_html/projects/aha-api/app/Console/Kernel.php
Back
<?php namespace App\Console; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; class Kernel extends ConsoleKernel { /** * Define the application's command schedule. */ protected function schedule(Schedule $schedule): void { // \Log::info('🟢 Scheduler triggered at: ' . now()); Log::channel('chatbot')->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, ]; }
| ver. 1.4 |
.
| PHP 8.1.32 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings