public function restore($workerInstance)
    {
        list($hostname, $pid, $queues) = explode(':', $workerInstance, 3);
        if (!is_array($queues)) {
            $queues = explode(',', $queues);
        }

        $this->queues = $queues;
        $this->pid = $pid;
        $this->id = $workerInstance; //regenerate worker
        $data = $this->resqueInstance->redis->get($this->workerName() . ':' . $workerInstance);
        if ($data !== false) {
            $data = json_decode($data, true);
            $this->currentJob = new ResqueJobBase($this->resqueInstance, $data['queue'], $data['payload'], true);
        }
        $workerPids = self::workerPids();
        if (!in_array($pid, $workerPids)) {
            $this->unregisterWorker();
            return false;
        }
        return true;
    }
public function restore($workerInstance)
    {
        list($hostname, $pid, $queues) = explode(':', $workerInstance, 3);
        if (!is_array($queues)) {
            $queues = explode(',', $queues);
        }

        $this->queues = $queues;
        $this->pid = $pid;
        $this->id = $workerInstance; //regenerate worker
        $data = $this->resqueInstance->redis->get($this->workerName() . ':' . $workerInstance);
        if ($data !== false) {
            $data = json_decode($data, true);
            $this->currentJob = new ResqueJobBase($this->resqueInstance, $data['queue'], $data['payload'], true);
        }
        $workerPids = self::workerPids();
        if (!in_array($pid, $workerPids)) {
            $this->unregisterWorker();
            return false;
        }
        return true;
    }
public function restore ( $ workerInstance ) { list ( $ hostname , $ pid , $ queues ) = explode ( ':' , $ workerInstance , 3 ) ; if ( ! is_array ( $ queues ) ) { $ queues = explode ( ',' , $ queues ) ; } $ this -> queues = $ queues ; $ this -> pid = $ pid ; $ this -> id = $ workerInstance ; //regenerate worker $ data = $ this -> resqueInstance -> redis -> get ( $ this -> workerName ( ) . ':' . $ workerInstance ) ; if ( $ data !== false ) { $ data = json_decode ( $ data , true ) ; $ this -> currentJob = new ResqueJobBase ( $ this -> resqueInstance , $ data [ 'queue' ] , $ data [ 'payload' ] , true ) ; } $ workerPids = self :: workerPids ( ) ; if ( ! in_array ( $ pid , $ workerPids ) ) { $ this -> unregisterWorker ( ) ; return false ; } return true ; }
Method for regenerate worker from the current ID saved in the redis and the instance in the server
@param $workerInstance
@return boolean // Success or Fail
Method for regenerate worker from the current ID saved in the redis and the instance in the server