1

I have a doubt with the 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.

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. I don't know which is the best option to execute this command every second.

halfer
  • 18,701
  • 13
  • 79
  • 158
jc1992
  • 644
  • 2
  • 9
  • 21
  • 1
    You want to execute a task every _second_? That's quite frequent - what does it do? Most cron/scheduler systems don't operate at this frequency - they are generally every minute at most. – halfer Aug 15 '15 at 11:20
  • Yes , for example 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. – jc1992 Aug 15 '15 at 11:31
  • 1
    I'd probably use a [MySQL event](https://dev.mysql.com/doc/refman/5.5/en/create-event.html) for that - looks like it supports second granularity. – halfer Aug 15 '15 at 11:33
  • Ok , I try to find information about this now. – jc1992 Aug 15 '15 at 11:38
  • 1
    I am using MySQL with Laravel. – jc1992 Aug 15 '15 at 11:42

1 Answers1

0

You need to use CronJob to triger php artisan schedule:run every second even if site is not opened. But since you are on Windows you have few alternatives to CronJob. Look at What is the Windows version of cron? for more information about scheaduling tasks in Windows.

Community
  • 1
  • 1
Milos Miskone Sretin
  • 1,608
  • 1
  • 24
  • 44