@@ -31,13 +31,13 @@ |
||
31 | 31 | private $shutdown = false; |
32 | 32 | |
33 | 33 | /** |
34 | - * The primary loop for a worker. |
|
35 | - * |
|
36 | - * Every $interval (seconds), the scheduled queue will be checked for jobs |
|
37 | - * that should be pushed to Resque. |
|
38 | - * |
|
39 | - * @param int $interval How often to check schedules. |
|
40 | - */ |
|
34 | + * The primary loop for a worker. |
|
35 | + * |
|
36 | + * Every $interval (seconds), the scheduled queue will be checked for jobs |
|
37 | + * that should be pushed to Resque. |
|
38 | + * |
|
39 | + * @param int $interval How often to check schedules. |
|
40 | + */ |
|
41 | 41 | public function work($interval = null) |
42 | 42 | { |
43 | 43 | 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. |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $this->registerSigHandlers(); |
49 | 49 | |
50 | 50 | while (true) { |
51 | - if($this->shutdown) { |
|
51 | + if ($this->shutdown) { |
|
52 | 52 | break; |
53 | 53 | } |
54 | 54 | $this->handleDelayedItems(); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | { |
85 | 85 | $item = null; |
86 | 86 | while ($item = ResqueScheduler::nextItemForTimestamp($timestamp)) { |
87 | - $this->log('queueing ' . $item['class'] . ' in ' . $item['queue'] .' [delayed]'); |
|
87 | + $this->log('queueing ' . $item['class'] . ' in ' . $item['queue'] . ' [delayed]'); |
|
88 | 88 | |
89 | 89 | Resque_Event::trigger('beforeDelayedEnqueue', array( |
90 | 90 | 'queue' => $item['queue'], |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | private function updateProcLine($status) |
118 | 118 | { |
119 | - if(function_exists('setproctitle')) { |
|
119 | + if (function_exists('setproctitle')) { |
|
120 | 120 | setproctitle('resque-scheduler-' . ResqueScheduler::VERSION . ': ' . $status); |
121 | 121 | } |
122 | 122 | } |
@@ -128,10 +128,10 @@ discard block |
||
128 | 128 | */ |
129 | 129 | public function log($message) |
130 | 130 | { |
131 | - if($this->logLevel == self::LOG_NORMAL) { |
|
131 | + if ($this->logLevel == self::LOG_NORMAL) { |
|
132 | 132 | fwrite(STDOUT, "*** " . $message . "\n"); |
133 | 133 | } |
134 | - else if($this->logLevel == self::LOG_VERBOSE) { |
|
134 | + else if ($this->logLevel == self::LOG_VERBOSE) { |
|
135 | 135 | fwrite(STDOUT, "** [" . strftime('%T %Y-%m-%d') . "] " . $message . "\n"); |
136 | 136 | } |
137 | 137 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | */ |
146 | 146 | private function registerSigHandlers() |
147 | 147 | { |
148 | - if(!function_exists('pcntl_signal')) { |
|
148 | + if (!function_exists('pcntl_signal')) { |
|
149 | 149 | return; |
150 | 150 | } |
151 | 151 |