src/Shell/CakeResqueShell.php
public function restart()
    {
        $workersArgs = $this->ResqueStatus->getWorkers();

        $this->params['all'] = true;
        $this->stop();

        $this->out('<info>' . __d('cake_resque', 'Restarting workers') . '</info>');
        if (!empty($workersArgs)) {
            $debug = $this->params['debug'];
            $this->debug(__d('cake_resque', 'Found ' . count($workersArgs) . ' workers to restart'));

            foreach ($workersArgs as $workerArgs) {
                $workerArgs['debug'] = $debug;
                if (isset($workerArgs['type']) && $workerArgs['type'] === 'scheduler') {
                    $this->startScheduler($workerArgs);
                } else {
                    $this->start($workerArgs);
                }
            }
            $this->out('');
        } else {
            $this->out('<warning>' . __d('cake_resque', 'No active workers found, will start brand new worker') . '</warning>');
            $this->start();
        }
    }
public function restart()
    {
        $workersArgs = $this->ResqueStatus->getWorkers();

        $this->params['all'] = true;
        $this->stop();

        $this->out('<info>' . __d('cake_resque', 'Restarting workers') . '</info>');
        if (!empty($workersArgs)) {
            $debug = $this->params['debug'];
            $this->debug(__d('cake_resque', 'Found ' . count($workersArgs) . ' workers to restart'));

            foreach ($workersArgs as $workerArgs) {
                $workerArgs['debug'] = $debug;
                if (isset($workerArgs['type']) && $workerArgs['type'] === 'scheduler') {
                    $this->startScheduler($workerArgs);
                } else {
                    $this->start($workerArgs);
                }
            }
            $this->out('');
        } else {
            $this->out('<warning>' . __d('cake_resque', 'No active workers found, will start brand new worker') . '</warning>');
            $this->start();
        }
    }
public function restart ( ) { $ workersArgs = $ this -> ResqueStatus -> getWorkers ( ) ; $ this -> params [ 'all' ] = true ; $ this -> stop ( ) ; $ this -> out ( '<info>' . __d ( 'cake_resque' , 'Restarting workers' ) . '</info>' ) ; if ( ! empty ( $ workersArgs ) ) { $ debug = $ this -> params [ 'debug' ] ; $ this -> debug ( __d ( 'cake_resque' , 'Found ' . count ( $ workersArgs ) . ' workers to restart' ) ) ; foreach ( $ workersArgs as $ workerArgs ) { $ workerArgs [ 'debug' ] = $ debug ; if ( isset ( $ workerArgs [ 'type' ] ) && $ workerArgs [ 'type' ] === 'scheduler' ) { $ this -> startScheduler ( $ workerArgs ) ; } else { $ this -> start ( $ workerArgs ) ; } } $ this -> out ( '' ) ; } else { $ this -> out ( '<warning>' . __d ( 'cake_resque' , 'No active workers found, will start brand new worker' ) . '</warning>' ) ; $ this -> start ( ) ; } }
Restart all workers.

Note: The workers status is conveniently stored by ResqueStatus.

@return void
@see ResqueStatus\ResqueStatus::getWorkers()
Restart all workers .