Skip to content

Commit

Permalink
Added docblock
Browse files Browse the repository at this point in the history
  • Loading branch information
peppeocchi committed Oct 19, 2020
1 parent 616042a commit 9d66559
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/GO/Scheduler.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,15 @@ public function clearJobs()
return $this;
}

public function work($interval = [0])
/**
* Start a worker.
*
* @param array $seconds - When the scheduler should run
*/
public function work(array $seconds = [0])
{
while (true) {
if (in_array((int) date('s'), $interval)) {
if (in_array((int) date('s'), $seconds)) {
$this->run();
sleep(1);
}
Expand Down

0 comments on commit 9d66559

Please sign in to comment.