Laravel时间表:运行不正常

时间:2017-09-18 09:42:21

标签: laravel laravel-5 laravel-forge laravel-5.5

所以我Kernel.php喜欢这样:

<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        'App\Console\Commands\IcalConvert',
        'App\Console\Commands\NewsScrape',
        'App\Console\Commands\CinemaScrape',
        'App\Console\Commands\DownloadIcal',
        'App\Console\Commands\EventCreate',
        'App\Console\Commands\EventDelete',
        'App\Console\Commands\EventUpdate',
        'App\Console\Commands\DeleteOldEvents',
        'App\Console\Commands\ClearEvents',
        'App\Console\Commands\EventReCalculate',
        'App\Console\Commands\MondayEmail',
        'App\Console\Commands\UploadToS3'
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        $ping =  config('app.ping');
        /*
        $schedule->command('scrape:news')
                 ->hourly()
                 ->weekdays()
                 ->between('7:00', '18:00')
                 ->sendOutputTo($log)
                 ->thenPing($ping);
        */
        $schedule->command('scrape:cinema')
                 ->dailyAt('04:00')
                 ->sendOutputTo($log)
                 ->thenPing($ping);
        $schedule->command('ical:download')
                 ->hourly()
                 ->sendOutputTo($log)
                 ->thenPing($ping);
        $schedule->command('ical:convert')
                 ->hourly()
                 ->sendOutputTo($log)
                 ->thenPing($ping);
        $schedule->command('events:forcedelete')
                 ->dailyAt('02:00')
                 ->sendOutputTo($log)
                 ->thenPing($ping);
        $schedule->command('events:recalculate')
                ->dailyAt('2:15')
                ->sendOutputTo($log)
                ->thenPing($ping);
        $schedule->command('event:clear')
                 ->everyTenMinutes()
                 ->sendOutputTo($log)
                 ->thenPing($ping);
    }

    /**
     * Register the Closure based commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        require base_path('routes/console.php');
    }
}

forge

205984 Every Minute * * * * * forge php /home/forge/app.com/current/artisan schedule:run

日志说命令正在被触发,即:

scheduling scrape:cinema等,

然而没有任何反应。命令应该调用应该进入队列的作业,但队列是空的!

当我手动触发命令时,它工作正常!

当我按照这样的方式安排工作时:

 205986 Every Minute * * * * * forge php /home/forge/app.com/current/artisan scrape:cinema

它也可以。

发生了什么......

0 个答案:

没有答案
相关问题