Laravel Scheduler是否有可能跳过命令?

我有一个Kernel.php,其中定义了许多不同的命令,如下所示:

(Laravel v5.5。*)

<?php

.....

protected function schedule(Schedule $schedule)
{
    $fileCronLog = '/var/log/laravel-scheduler.log';

    $schedule->command('do:something params...')->everyFiveMinutes()->appendOutputTo($fileCronLog);
    $schedule->command('do:something params...')->everyMinute()->appendOutputTo($fileCronLog);
    $schedule->command('do:something params...')->everyMinute()->appendOutputTo($fileCronLog);
    $schedule->command('do:something params...')->everyMinute()->appendOutputTo($fileCronLog);
    $schedule->command('do:something params...')->everyMinute()->appendOutputTo($fileCronLog);
    $schedule->command('do:something params...')->everyMinute()->appendOutputTo($fileCronLog);
    $schedule->command('do:something params...')->everyTenminutes()->appendOutputTo($fileCronLog);
    $schedule->command('do:something params...')->everyFiveMinutes()->appendOutputTo($fileCronLog);
    $schedule->command('do:something params...')->everyTenminutes()->appendOutputTo($fileCronLog);
    $schedule->command('do:something params...')->everyThirtyMinutes()->appendOutputTo($fileCronLog);

    .......

我注意到有时有些进程/命令根本无法启动...

与频率较低的命令相匹配,例如: everyTenminuteseveryThirtyMinutes .....

我假设当crontab启动Laravel schedule:run时,Laravel可能会在内部将所有计划的命令排入队列……也许第一个命令要花费一分钟以上的时间来处理……所以当命令everyTenminutes的时间已经过去,Laravel跳过了执行。...

是这种情况吗?或者也许Laravel如果过载会在一段时间后放弃处理计划?

我已经注意到Laravel不会派生php进程,而是顺序执行它们。过去我已经通过直接在crontab中并行执行某些命令来解决了这个问题...

我该如何克服?有什么方法或方法可以直接利用框架吗?

xunyanli 回答:Laravel Scheduler是否有可能跳过命令?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3167114.html

大家都在问