/** * After action * * @param $event \yii\base\ActionEvent */ public function afterAction($event) { if ($this->schedule) { if ($event->result === false) { $exitCode = CronScheduleStatus::ERROR; } else { $exitCode = CronScheduleStatus::SUCCESS; } $this->schedule->endCronSchedule($exitCode); $this->schedule = null; } }
/** * Run action */ public function run() { $dataProvider = new ActiveDataProvider(['query' => CronScheduleModel::find(), 'pagination' => ['pageSize' => 20], 'sort' => ['defaultOrder' => ['id' => SORT_DESC]]]); return $this->controller->render($this->view, ['dataProvider' => $dataProvider]); }