mirror of
https://github.com/idanoo/php-resque
synced 2025-07-01 13:42:22 +00:00
Fix a bug where the worker would spin out of control taking the server with it, if the redis connection was interrupted even briefly. Use SIGPIPE to trap this scenario cleanly.
This commit is contained in:
parent
700af834b4
commit
c90e21d88e
2 changed files with 14 additions and 0 deletions
|
@ -49,6 +49,10 @@ class Redisent {
|
|||
function __construct($host, $port = 6379) {
|
||||
$this->host = $host;
|
||||
$this->port = $port;
|
||||
$this->establishConnection();
|
||||
}
|
||||
|
||||
function establishConnection() {
|
||||
$this->__sock = fsockopen($this->host, $this->port, $errno, $errstr);
|
||||
if (!$this->__sock) {
|
||||
throw new Exception("{$errno} - {$errstr}");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue