Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cron times in Seconds? #41

Closed
kristopherlarson opened this issue Oct 19, 2017 · 3 comments
Closed

Cron times in Seconds? #41

kristopherlarson opened this issue Oct 19, 2017 · 3 comments

Comments

@kristopherlarson
Copy link

Is it possible to setup a schedule to run every 10 seconds or lets say 30 seconds?

@peppeocchi
Copy link
Owner

Hi, unfortunately I don't think this is possible out of the box, the minimum interval for a cron is 1 minute (the scheduler will run every minute).

I suggest you to implement your own way of handling smaller intervals, one idea would be to pause the scheduler every 10 seconds (make sure all your jobs can run in background)

$scheduler->php('somescript.php');

for ($i = 0; $i < 6; $i++) {
    $scheduler->run();
    sleep(10);
}

You can read more about multiple runs here.

@kristopherlarson
Copy link
Author

Okay do you think I would run into any issues doing something like this? Memory leaks or anything.

@peppeocchi
Copy link
Owner

@kristopherlarson I don't think so, it really depends on what each job is doing. I would advice you to setup only background jobs that won't block the scheduler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants