简体   繁体   English

调度程序任务的标识在Laravel 5中

[英]Pid of scheduler task in Laravel 5

I have added a task to the Scheduler in app/console/kernel.php . 我在app/console/kernel.php任务添加到了Scheduler中。 Like so: 像这样:

$schedule->command('atomaton:socket_start --port=8080')
     ->withoutOverlapping()
     ->appendOutputTo(base_path().'/atomaton/storage/atnSocket.log');

So my question is: How do I find out if that command is running? 所以我的问题是:如何确定该命令是否正在运行? Can I get the PID? 我可以获取PID吗?

I found when you call withoutOverlapping() laravel will create a file in storage/framework/ , like schedule-xxxxx which could be detected when php artisan schedule:run for avoiding task overlap. 我发现,当您调用withoutOverlapping() laravel将在storage/framework/创建一个文件,例如schedule-xxxxx ,当php artisan schedule:run为避免任务重叠而运行时可以检测到该文件。

Tested on Laravel 5.0. 在Laravel 5.0上测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM