From: fomichev Date: Wed, 2 Jul 2025 11:26:54 +0000 (+0300) Subject: Изменение логики работы задачи X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=88dd1b762a7b05077f2f6b7f1e1a97b11be696ec;p=erp24_rep%2Fyii-erp24%2F.git Изменение логики работы задачи --- diff --git a/erp24/commands/CronController.php b/erp24/commands/CronController.php index f33a37a2..4561c5a0 100644 --- a/erp24/commands/CronController.php +++ b/erp24/commands/CronController.php @@ -1785,7 +1785,8 @@ class CronController extends Controller } if (isset($task['status']) && $task['status'] === 'pending') { $task['status'] = 'running'; - $cache->set($cacheKey, $task); + //$ok = $cache->set($cacheKey, $task); + $log = new ScriptLauncherLog(); $log->source = 'CronController'; @@ -1803,7 +1804,8 @@ class CronController extends Controller Yii::error(json_encode($log->getErrors(), JSON_UNESCAPED_UNICODE)); LogService::apiErrorLog(json_encode(["error_id" => 8, "error" => $log->getErrors()], JSON_UNESCAPED_UNICODE)); } - //$cache->delete($cacheKey); + $ok = $cache->delete($cacheKey); + $service = new AutoPlannogrammaService(); $year = (int)$task['year']; $month = (int)$task['month']; diff --git a/erp24/controllers/CategoryPlanController.php b/erp24/controllers/CategoryPlanController.php index 65492e80..3fed6dbc 100644 --- a/erp24/controllers/CategoryPlanController.php +++ b/erp24/controllers/CategoryPlanController.php @@ -645,7 +645,7 @@ class CategoryPlanController extends Controller { return $this->asJson(['status' => 'not_found']); } } - Yii::$app->cache->delete('apRecalculateTask'); + //Yii::$app->cache->delete('apRecalculateTask'); return $this->asJson([ 'status' => $task['status'], 'progress' => $task['progress'] ?? 0,