Skip to content

Commit

Permalink
Merge branch 'master' into v2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
peppeocchi committed Sep 20, 2017
2 parents 669ef65 + dd31f57 commit 2bec937
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,15 @@ $scheduler->resetRun()

Another handy method if you are re-using the same instance of the scheduler with different jobs (e.g. job coming from an external source - db, file ...) on every run, is to clear the current scheduled jobs.
```php
$scheduler->clearJobs()
->resetRun()
->run(); // now we can run it again
$scheduler->clearJobs();

$jobsFromDb = $db->query(/*...*/);
foreach ($jobsFromDb as $job) {
$scheduler->php($job->script)->at($job->schedule);
}

$scheduler->resetRun()
->run();
```

### Faking scheduler run time
Expand Down

0 comments on commit 2bec937

Please sign in to comment.