info('Starting Workerman AI runtime (queues: ai-content, ai-moderation)...'); Worker::$pidFile = storage_path('logs/workerman-ai.pid'); Worker::$logFile = storage_path('logs/workerman-ai.log'); $worker = new Worker(); $worker->count = max(1, (int) $this->option('count')); $worker->name = 'larablog-ai'; $worker->onWorkerStart = function () { Timer::add(1, function () { Artisan::call('queue:work', [ '--queue' => 'ai-content,ai-moderation', '--stop-when-empty' => true, '--max-time' => 50, '--sleep' => 1, '--tries' => 3, ]); }); }; Worker::runAll(); return self::SUCCESS; } }