停止注视Laravel计划的命令吗? [英] Stop a Laravel scheduled command once stared?

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

问题描述

因此,我为laravel 5.1项目设置了计划的命令.它有效,命令已经启动,但是很愚蠢的是我没有考虑过如何停止它.通常,您不想停止它,但是该命令正在将近一百万行插入数据库表中,而我只想确保无需登录服务器就可以启动它.我显然需要在某个时候运行它,但现在不需要,所以有没有办法停止命令中流?

So I have set up a scheduled command for a laravel 5.1 project. It works, the command has started, but rather foolishly I didn't think about how I might stop it. Normally you wouldn't want to stop it, but the command is inserting nearly half a million rows into a database table, and I only really wanted to make sure I could start it without being logged into the server. I will obviously need to run it at some point but not right now, so is there a way to stop the command mid-flow?

推荐答案

在我发现计划的代码中存在错误之后,这对我来说很有效,并且它将保持很长一段时间. SSH进入服务器.

This worked for me after I found a fault in my scheduled code and it was going to keep running for a really long time. SSH into the server.

ps -fe | grep artisan

然后杀死PID(PID是进程号).杀死前两个结果对我有用.

then kill PID (PID being the number of the process). Killing the first two results worked for me.

注意:如果使用的是withoutOverlapping(),则除非将-> name()更改为唯一的内容,否则该过程将不会再次启动.

Note: If you are using withoutOverlapping() the process will not start up again unless you change the ->name() to something unique.

这篇关于停止注视Laravel计划的命令吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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