@@ -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 | } |
@@ -122,11 +122,9 @@ discard block |
||
122 | 122 | try { |
123 | 123 | if (is_array($server)) { |
124 | 124 | $this->driver = new Credis_Cluster($server); |
125 | - } |
|
126 | - else if (is_object($client)) { |
|
125 | + } else if (is_object($client)) { |
|
127 | 126 | $this->driver = $client; |
128 | - } |
|
129 | - else { |
|
127 | + } else { |
|
130 | 128 | list($host, $port, $dsnDatabase, $user, $password, $options) = self::parseDsn($server); |
131 | 129 | // $user is not used, only $password |
132 | 130 | |
@@ -151,8 +149,7 @@ discard block |
||
151 | 149 | if ($database !== null) { |
152 | 150 | $this->driver->select($database); |
153 | 151 | } |
154 | - } |
|
155 | - catch(CredisException $e) { |
|
152 | + } catch(CredisException $e) { |
|
156 | 153 | throw new Resque_RedisException('Error communicating with Redis: ' . $e->getMessage(), 0, $e); |
157 | 154 | } |
158 | 155 | } |
@@ -247,8 +244,7 @@ discard block |
||
247 | 244 | foreach ($args[0] AS $i => $v) { |
248 | 245 | $args[0][$i] = self::$defaultNamespace . $v; |
249 | 246 | } |
250 | - } |
|
251 | - else { |
|
247 | + } else { |
|
252 | 248 | $args[0] = self::$defaultNamespace . $args[0]; |
253 | 249 | } |
254 | 250 | } elseif (in_array($name, $this->scanCommands)) { |
@@ -257,8 +253,7 @@ discard block |
||
257 | 253 | } |
258 | 254 | try { |
259 | 255 | return $this->driver->__call($name, $args); |
260 | - } |
|
261 | - catch (CredisException $e) { |
|
256 | + } catch (CredisException $e) { |
|
262 | 257 | throw new Resque_RedisException('Error communicating with Redis: ' . $e->getMessage(), 0, $e); |
263 | 258 | } |
264 | 259 | } |