Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/Resque/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@
class Resque_Exception extends Exception
{
}
?>
1 change: 0 additions & 1 deletion lib/Resque/Failure/Interface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ interface Resque_Failure_Interface
*/
public function __construct($payload, $exception, $worker, $queue);
}
?>
1 change: 0 additions & 1 deletion lib/Resque/Failure/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@ public function __construct($payload, $exception, $worker, $queue)
Resque::redis()->rpush('failed', $data);
}
}
?>
1 change: 0 additions & 1 deletion lib/Resque/Job.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,4 +269,3 @@ public function __toString()
return '(' . implode(' | ', $name) . ')';
}
}
?>
1 change: 0 additions & 1 deletion lib/Resque/Job/Status.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,3 @@ public function __toString()
return 'job:' . $this->id . ':status';
}
}
?>
13 changes: 12 additions & 1 deletion lib/Resque/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,18 @@ public function work($interval = Resque::DEFAULT_INTERVAL, $blocking = false)
if($this->shutdown) {
break;
}

// is redis still alive?
try {
if (Resque::redis()->ping() === false) {
throw new CredisException('redis ping() failed');
}
} catch (CredisException $e) {
$this->logger->log(Psr\Log\LogLevel::ERROR, 'redis went away. trying to reconnect');
Resque::$redis = null;
usleep($interval * 1000000);
continue;
}

// Attempt to find and reserve a job
$job = false;
Expand Down Expand Up @@ -564,4 +576,3 @@ public function setLogger(Psr\Log\LoggerInterface $logger)
$this->logger = $logger;
}
}
?>