@@ -227,8 +227,7 @@ |
||
227 | 227 | ); |
228 | 228 | try { |
229 | 229 | Resque_Event::trigger('beforeEnqueue', $hookParams); |
230 | - } |
|
231 | - catch(Resque_Job_DontCreate $e) { |
|
230 | + } catch(Resque_Job_DontCreate $e) { |
|
232 | 231 | return false; |
233 | 232 | } |
234 | 233 |
@@ -182,8 +182,7 @@ discard block |
||
182 | 182 | $this->logger->log(Psr\Log\LogLevel::INFO, 'Sleeping for {interval}', array('interval' => $interval)); |
183 | 183 | if($this->paused) { |
184 | 184 | $this->updateProcLine('Paused'); |
185 | - } |
|
186 | - else { |
|
185 | + } else { |
|
187 | 186 | $this->updateProcLine('Waiting for ' . implode(',', $this->queues)); |
188 | 187 | } |
189 | 188 | |
@@ -225,8 +224,7 @@ discard block |
||
225 | 224 | $job->fail(new Resque_Job_DirtyExitException( |
226 | 225 | 'Job exited with exit code ' . $exitStatus |
227 | 226 | )); |
228 | - } |
|
229 | - else |
|
227 | + } else |
|
230 | 228 | { |
231 | 229 | if (in_array($job->getStatus(), array(Resque_Job_Status::STATUS_WAITING, Resque_Job_Status::STATUS_RUNNING))) |
232 | 230 | { |
@@ -253,8 +251,7 @@ discard block |
||
253 | 251 | try { |
254 | 252 | Resque_Event::trigger('afterFork', $job); |
255 | 253 | $job->perform(); |
256 | - } |
|
257 | - catch(Exception $e) { |
|
254 | + } catch(Exception $e) { |
|
258 | 255 | $this->logger->log(Psr\Log\LogLevel::CRITICAL, '{job} has failed {stack}', array('job' => $job, 'stack' => $e)); |
259 | 256 | $job->fail($e); |
260 | 257 | return; |
@@ -347,8 +344,7 @@ discard block |
||
347 | 344 | $processTitle = 'resque-' . Resque::VERSION . ': ' . $status; |
348 | 345 | if(function_exists('cli_set_process_title') && PHP_OS !== 'Darwin') { |
349 | 346 | cli_set_process_title($processTitle); |
350 | - } |
|
351 | - else if(function_exists('setproctitle')) { |
|
347 | + } else if(function_exists('setproctitle')) { |
|
352 | 348 | setproctitle($processTitle); |
353 | 349 | } |
354 | 350 | } |
@@ -431,8 +427,7 @@ discard block |
||
431 | 427 | $this->logger->log(Psr\Log\LogLevel::DEBUG, 'Child {child} found, killing.', array('child' => $this->child)); |
432 | 428 | posix_kill($this->child, SIGKILL); |
433 | 429 | $this->child = null; |
434 | - } |
|
435 | - else { |
|
430 | + } else { |
|
436 | 431 | $this->logger->log(Psr\Log\LogLevel::INFO, 'Child {child} not found, restarting.', array('child' => $this->child)); |
437 | 432 | $this->shutdown(); |
438 | 433 | } |
@@ -554,8 +549,7 @@ discard block |
||
554 | 549 | $job = Resque::redis()->get('worker:' . $this); |
555 | 550 | if(!$job) { |
556 | 551 | return array(); |
557 | - } |
|
558 | - else { |
|
552 | + } else { |
|
559 | 553 | return json_decode($job, true); |
560 | 554 | } |
561 | 555 | } |
@@ -115,11 +115,9 @@ discard block |
||
115 | 115 | try { |
116 | 116 | if (is_array($server)) { |
117 | 117 | $this->driver = new Credis_Cluster($server); |
118 | - } |
|
119 | - else if (is_object($client)) { |
|
118 | + } else if (is_object($client)) { |
|
120 | 119 | $this->driver = $client; |
121 | - } |
|
122 | - else { |
|
120 | + } else { |
|
123 | 121 | list($host, $port, $dsnDatabase, $user, $password, $options) = self::parseDsn($server); |
124 | 122 | // $user is not used, only $password |
125 | 123 | |
@@ -144,8 +142,7 @@ discard block |
||
144 | 142 | if ($database !== null) { |
145 | 143 | $this->driver->select($database); |
146 | 144 | } |
147 | - } |
|
148 | - catch(CredisException $e) { |
|
145 | + } catch(CredisException $e) { |
|
149 | 146 | throw new Resque_RedisException('Error communicating with Redis: ' . $e->getMessage(), 0, $e); |
150 | 147 | } |
151 | 148 | } |
@@ -240,15 +237,13 @@ discard block |
||
240 | 237 | foreach ($args[0] AS $i => $v) { |
241 | 238 | $args[0][$i] = self::$defaultNamespace . $v; |
242 | 239 | } |
243 | - } |
|
244 | - else { |
|
240 | + } else { |
|
245 | 241 | $args[0] = self::$defaultNamespace . $args[0]; |
246 | 242 | } |
247 | 243 | } |
248 | 244 | try { |
249 | 245 | return $this->driver->__call($name, $args); |
250 | - } |
|
251 | - catch (CredisException $e) { |
|
246 | + } catch (CredisException $e) { |
|
252 | 247 | throw new Resque_RedisException('Error communicating with Redis: ' . $e->getMessage(), 0, $e); |
253 | 248 | } |
254 | 249 | } |