Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeks-semenov committed Sep 14, 2020
1 parent ae60e47 commit 20cb114
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/CmsAgentComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use skeeks\cms\helpers\FileHelper;
use yii\base\BootstrapInterface;
use yii\base\Component;
use yii\base\Exception;
use yii\helpers\ArrayHelper;
use yii\web\Application;
use Yii;
Expand Down Expand Up @@ -91,9 +92,11 @@ public function loadAgents()
$agent = new CmsAgentModel();
$agent->name = $command->command;
$agent->agent_interval = $command->interval;
$agent->is_period = $command->is_period;
$agent->is_period = (int) $command->is_period;
$agent->description = $command->name;
$agent->save();
if (!$agent->save()) {
throw new Exception(print_r($agent->errors, true));
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/views/admin-cms-agent/_before-index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

$backend = \yii\helpers\Url::to(['load']);
$backendStop = \yii\helpers\Url::to(['stop-executable']);

/*print_r(\Yii::$app->cmsAgent->commands);die;*/
$this->registerJs(<<<JS
setInterval(function() {
Expand Down

0 comments on commit 20cb114

Please sign in to comment.