简体   繁体   English

Windows中带有Laravel5的调度程序任务

[英]Scheduler Task with Laravel5 in Windows

I have a doubt with the SchedulerTasks. 我对SchedulerTasks有疑问。 I created the command in Laravel 5.0 called log::company , this command I need to be executed every second, even if website is not opened. 我在Laravel 5.0中创建了名为log::company命令,即使网站未打开,我也需要每秒执行一次此命令。

I have an auction, when the time of auction finish I need to change the state of the auction to 'finished', with this command I change this state, for this reason I need to use this command every second. 我有一个拍卖,拍卖完成时,我需要将拍卖状态更改为“完成”,使用此命令可以更改此状态,因此,我需要每秒使用此命令。

But I use Windows and the documentation of Laravel5.0 shows how to use with Ubuntu. 但是我使用Windows,Laravel5.0的文档显示了如何与Ubuntu一起使用。 I don't know which is the best option to execute this command every second. 我不知道哪个是每秒执行此命令的最佳选择。

You need to use CronJob to triger php artisan schedule:run every second even if site is not opened. 您需要使用CronJob触发php artisan schedule:即使未打开网站,也要每秒运行一次。 But since you are on Windows you have few alternatives to CronJob. 但是由于您使用的是Windows,因此CronJob几乎没有其他选择。 Look at What is the Windows version of cron? 看看什么是Windows版本的cron? for more information about scheaduling tasks in Windows. 有关Windows中的阻塞任务的更多信息。

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

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