代码之家  ›  专栏  ›  技术社区  ›  Petay87

Laravel队列未从Kernel.php读取更新

  •  0
  • Petay87  · 技术社区  · 6 年前

    背景

    php artisan queue:work --tries=3 我也看到了工作的进展。仅供参考-我使用Redis作为队列驱动程序。

    namespace App\Console;
    
    use Artisan;
    use Illuminate\Console\Scheduling\Schedule;
    use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
    use App\Jobs\FetchMajorProblems;
    
    class Kernel extends ConsoleKernel
    {
        /**
         * The Artisan commands provided by your application.
         *
         * @var array
         */
        protected $commands = [
            //
            'App\Console\Commands\MassAssignRole',
            'App\Console\Commands\ClearLogs',
        ];
    
        /**
         * Define the application's command schedule.
         *
         * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
         * @return void
         */
        protected function schedule(Schedule $schedule)
        {
    
           $schedule->command('horizon:snapshot')->everyFiveMinutes();
    
           $schedule->job(new FetchMajorProblems)->everyFiveMinutes();
    
        }
    
        /**
         * Register the Closure based commands for the application.
         *
         * @return void
         */
        protected function commands()
        {
            require base_path('routes/console.php');
        }
    }
    

    问题

    我现在创造了一份新工作 FetchMajorProblems

    • 补充 use App\Jobs\FetchMajorIncidents; 到顶端。
    • $schedule->job(new FetchMajorIncidents)->everyFiveMinutes(); 调度函数。

    然而,新的 FetchMajorIncidents

    我试过的

    我试过以下方法:

    • 重新开始的地平线
    • 重新启动服务器
    • 清除了php配置
    • 清除了php视图
    • 已运行作曲家转储自动加载

    $schedule->job(new FetchMajorProblems)->everyFiveMinutes(); . 问题是,即使这个被注释掉了,作业仍然每5分钟运行一次!

    0 回复  |  直到 6 年前