@@ -36,13 +36,13 @@ |
||
| 36 | 36 | private $paused = false; |
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | - * The primary loop for a worker. |
|
| 40 | - * |
|
| 41 | - * Every $interval (seconds), the scheduled queue will be checked for jobs |
|
| 42 | - * that should be pushed to Resque. |
|
| 43 | - * |
|
| 44 | - * @param int $interval How often to check schedules. |
|
| 45 | - */ |
|
| 39 | + * The primary loop for a worker. |
|
| 40 | + * |
|
| 41 | + * Every $interval (seconds), the scheduled queue will be checked for jobs |
|
| 42 | + * that should be pushed to Resque. |
|
| 43 | + * |
|
| 44 | + * @param int $interval How often to check schedules. |
|
| 45 | + */ |
|
| 46 | 46 | public function work($interval = null) |
| 47 | 47 | { |
| 48 | 48 | if ($interval !== null) { |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(ticks = 1); |
|
| 2 | +declare(ticks=1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * ResqueScheduler worker to handle scheduling of delayed tasks. |
@@ -53,10 +53,10 @@ discard block |
||
| 53 | 53 | $this->registerSigHandlers(); |
| 54 | 54 | |
| 55 | 55 | while (true) { |
| 56 | - if($this->shutdown) { |
|
| 56 | + if ($this->shutdown) { |
|
| 57 | 57 | break; |
| 58 | 58 | } |
| 59 | - if(!$this->paused) { |
|
| 59 | + if (!$this->paused) { |
|
| 60 | 60 | $this->handleDelayedItems(); |
| 61 | 61 | } |
| 62 | 62 | $this->sleep(); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | { |
| 92 | 92 | $item = null; |
| 93 | 93 | while ($item = ResqueScheduler::nextItemForTimestamp($timestamp)) { |
| 94 | - $this->log('queueing ' . $item['class'] . ' in ' . $item['queue'] .' [delayed]'); |
|
| 94 | + $this->log('queueing ' . $item['class'] . ' in ' . $item['queue'] . ' [delayed]'); |
|
| 95 | 95 | |
| 96 | 96 | Resque_Event::trigger('beforeDelayedEnqueue', array( |
| 97 | 97 | 'queue' => $item['queue'], |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | private function updateProcLine($status) |
| 125 | 125 | { |
| 126 | - if(function_exists('setproctitle')) { |
|
| 126 | + if (function_exists('setproctitle')) { |
|
| 127 | 127 | setproctitle('resque-scheduler-' . ResqueScheduler::VERSION . ': ' . $status); |
| 128 | 128 | } |
| 129 | 129 | } |
@@ -135,10 +135,10 @@ discard block |
||
| 135 | 135 | */ |
| 136 | 136 | public function log($message) |
| 137 | 137 | { |
| 138 | - if($this->logLevel == self::LOG_NORMAL) { |
|
| 138 | + if ($this->logLevel == self::LOG_NORMAL) { |
|
| 139 | 139 | fwrite(STDOUT, "*** " . $message . "\n"); |
| 140 | 140 | } |
| 141 | - else if($this->logLevel == self::LOG_VERBOSE) { |
|
| 141 | + else if ($this->logLevel == self::LOG_VERBOSE) { |
|
| 142 | 142 | fwrite(STDOUT, "** [" . strftime('%T %Y-%m-%d') . "] " . $message . "\n"); |
| 143 | 143 | } |
| 144 | 144 | } |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | */ |
| 153 | 153 | private function registerSigHandlers() |
| 154 | 154 | { |
| 155 | - if(!function_exists('pcntl_signal')) { |
|
| 155 | + if (!function_exists('pcntl_signal')) { |
|
| 156 | 156 | return; |
| 157 | 157 | } |
| 158 | 158 | |