Laravel 5.1任务计划命令问题 [英] Laravel 5.1 Task Scheduling command issue

查看:66
本文介绍了Laravel 5.1任务计划命令问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试执行两个控制台命令.下面是我的 Kernel.php

I am trying to execute two console commands.Below is my two commands in my Kernel.php

protected function schedule(Schedule $schedule)
{
    $schedule->command('users:get')->everyMinute();

    $schedule->command('users:update')->dailyAt('01:00');
}

当我运行 php artisan schedule:run 时,仅计划了被安排为 everyMinute 的命令.

When I run php artisan schedule:run, Only the command which is/are scheduled as everyMinute is scheduled.

正在运行的计划命令:'/usr/bin/php5''artisan'users:get>/dev/null 2>& 1&

Running scheduled command: '/usr/bin/php5' 'artisan' users:get > /dev/null 2>&1 &

如果我将第二条命令的 dailyAt 更改为 everyMinute ,则两者的安排都如下所示

If I change the dailyAt to everyMinute for the second command, both are scheduled as shown below

正在运行的计划命令:'/usr/bin/php5''artisan'users:get>/dev/null 2>& 1&

Running scheduled command: '/usr/bin/php5' 'artisan' users:get > /dev/null 2>&1 &

正在运行的计划命令:'/usr/bin/php5''artisan'users:update>/dev/null 2>& 1&

Running scheduled command: '/usr/bin/php5' 'artisan' users:update > /dev/null 2>&1 &

推荐答案

php artisan schedule:run将运行计划的命令,而不列出它们.

php artisan schedule:run will run the scheduled commands, not list them.

因此,如果您在01:00之前运行计划的命令,则users:update命令将不会被计划,也不会运行.

So, if you run the scheduled commands before 01:00 the users:update command will not be scheduled yet and will not be ran.

这篇关于Laravel 5.1任务计划命令问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆