mirror of
https://github.com/idanoo/php-resque.git
synced 2024-11-22 00:11:53 +00:00
Merge pull request #127 from ptrofimov/bug/establishConnection
Resque/Worker: removed reestablishConnection
This commit is contained in:
commit
b3c93367e8
@ -354,7 +354,6 @@ class Resque_Worker
|
|||||||
pcntl_signal(SIGUSR1, array($this, 'killChild'));
|
pcntl_signal(SIGUSR1, array($this, 'killChild'));
|
||||||
pcntl_signal(SIGUSR2, array($this, 'pauseProcessing'));
|
pcntl_signal(SIGUSR2, array($this, 'pauseProcessing'));
|
||||||
pcntl_signal(SIGCONT, array($this, 'unPauseProcessing'));
|
pcntl_signal(SIGCONT, array($this, 'unPauseProcessing'));
|
||||||
pcntl_signal(SIGPIPE, array($this, 'reestablishRedisConnection'));
|
|
||||||
$this->logger->log(Psr\Log\LogLevel::DEBUG, 'Registered signals');
|
$this->logger->log(Psr\Log\LogLevel::DEBUG, 'Registered signals');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -377,16 +376,6 @@ class Resque_Worker
|
|||||||
$this->paused = false;
|
$this->paused = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Signal handler for SIGPIPE, in the event the redis connection has gone away.
|
|
||||||
* Attempts to reconnect to redis, or raises an Exception.
|
|
||||||
*/
|
|
||||||
public function reestablishRedisConnection()
|
|
||||||
{
|
|
||||||
$this->logger->log(Psr\Log\LogLevel::NOTICE, 'SIGPIPE received; attempting to reconnect');
|
|
||||||
Resque::redis()->establishConnection();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Schedule a worker for shutdown. Will finish processing the current job
|
* Schedule a worker for shutdown. Will finish processing the current job
|
||||||
* and when the timeout interval is reached, the worker will shut down.
|
* and when the timeout interval is reached, the worker will shut down.
|
||||||
|
Loading…
Reference in New Issue
Block a user