public function actionStop($id)
    {
        if (!$this->module->canWorkerStop) {
            throw new ForbiddenHttpException(Module::t('notice', 'Stop is forbidden.'));
        }

        $record = $this->findRecord($id);
        $record->stop();
        return $this
            ->success(Module::t('notice', 'The worker will be stopped within {timeout} sec.', [
                'timeout' => $record->pinged_at + $this->env->workerPingInterval - time(),
            ]))
            ->redirect(['index']);
    }
public function actionStop($id)
    {
        if (!$this->module->canWorkerStop) {
            throw new ForbiddenHttpException(Module::t('notice', 'Stop is forbidden.'));
        }

        $record = $this->findRecord($id);
        $record->stop();
        return $this
            ->success(Module::t('notice', 'The worker will be stopped within {timeout} sec.', [
                'timeout' => $record->pinged_at + $this->env->workerPingInterval - time(),
            ]))
            ->redirect(['index']);
    }
public function actionStop ( $ id ) { if ( ! $ this -> module -> canWorkerStop ) { throw new ForbiddenHttpException ( Module :: t ( 'notice' , 'Stop is forbidden.' ) ) ; } $ record = $ this -> findRecord ( $ id ) ; $ record -> stop ( ) ; return $ this -> success ( Module :: t ( 'notice' , 'The worker will be stopped within {timeout} sec.' , [ 'timeout' => $ record -> pinged_at + $ this -> env -> workerPingInterval - time ( ) , ] ) ) -> redirect ( [ 'index' ] ) ; }
Stops a worker

@param int $id
@throws ForbiddenHttpException
@return \yii\web\Response
Stops a worker