Laravel 5.1任务计划命令问题

编程入门 行业动态 更新时间:2024-10-09 13:25:51
本文介绍了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任务计划命令问题

本文发布于:2023-11-27 11:45:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1637927.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:命令   计划   Laravel

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!