mirror of
https://github.com/idanoo/php-resque
synced 2025-07-01 05:32:20 +00:00
Merge branch 'master' of https://github.com/chrisboulton/php-resque
This commit is contained in:
commit
48a7febd88
5 changed files with 70 additions and 21 deletions
|
@ -39,7 +39,7 @@ class Resque_Redis extends Redisent
|
|||
'setnx',
|
||||
'incr',
|
||||
'incrby',
|
||||
'decrby',
|
||||
'decr',
|
||||
'decrby',
|
||||
'rpush',
|
||||
'lpush',
|
||||
|
|
|
@ -96,7 +96,7 @@ class Resque_Worker
|
|||
*/
|
||||
public static function find($workerId)
|
||||
{
|
||||
if(!self::exists($workerId)) {
|
||||
if(!self::exists($workerId) || false === strpos($workerId, ":")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -449,12 +449,14 @@ class Resque_Worker
|
|||
$workerPids = $this->workerPids();
|
||||
$workers = self::all();
|
||||
foreach($workers as $worker) {
|
||||
list($host, $pid, $queues) = explode(':', (string)$worker, 3);
|
||||
if($host != $this->hostname || in_array($pid, $workerPids) || $pid == getmypid()) {
|
||||
continue;
|
||||
}
|
||||
$this->log('Pruning dead worker: ' . (string)$worker, self::LOG_VERBOSE);
|
||||
$worker->unregisterWorker();
|
||||
if (is_object($worker)) {
|
||||
list($host, $pid, $queues) = explode(':', (string)$worker, 3);
|
||||
if($host != $this->hostname || in_array($pid, $workerPids) || $pid == getmypid()) {
|
||||
continue;
|
||||
}
|
||||
$this->log('Pruning dead worker: ' . (string)$worker, self::LOG_VERBOSE);
|
||||
$worker->unregisterWorker();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue