From: fomichev Date: Wed, 2 Jul 2025 11:33:49 +0000 (+0300) Subject: Изменение логики работы задачи X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=d2911b3ba3a50fab09c79d9117682dbc963847fb;p=erp24_rep%2Fyii-erp24%2F.git Изменение логики работы задачи --- diff --git a/erp24/commands/CronController.php b/erp24/commands/CronController.php index 4561c5a0..f37c189c 100644 --- a/erp24/commands/CronController.php +++ b/erp24/commands/CronController.php @@ -1785,7 +1785,7 @@ class CronController extends Controller } if (isset($task['status']) && $task['status'] === 'pending') { $task['status'] = 'running'; - //$ok = $cache->set($cacheKey, $task); + $ok = $cache->set($cacheKey, $task); $log = new ScriptLauncherLog(); diff --git a/erp24/config/console.php b/erp24/config/console.php index abb400af..660baa1d 100755 --- a/erp24/config/console.php +++ b/erp24/config/console.php @@ -42,8 +42,8 @@ $config = [ // ], 'queue' => [ 'class' => Queue::class, - // 'dsn' => 'amqp://admin:3qqHK2MRgGgxUdVT61@rabbitmq-yii_erp24:5672', - 'dsn' => 'amqp://admin:3qqHK2MRgGgxUdVT61@localhost:5672', + 'dsn' => 'amqp://admin:3qqHK2MRgGgxUdVT61@rabbitmq-yii_erp24:5672', + //'dsn' => 'amqp://admin:3qqHK2MRgGgxUdVT61@localhost:5672', 'queueName' => 'telegram-queue', 'as log' => \yii\queue\LogBehavior::class, 'ttr' => 300, // Время для выполнения задания @@ -55,6 +55,7 @@ $config = [ ], 'cache' => [ 'class' => 'yii\caching\FileCache', + 'cachePath' => '@yii_app/runtime/cache', ], 'log' => [ 'targets' => [ diff --git a/erp24/config/web.php b/erp24/config/web.php index 874a787c..6e9ef864 100644 --- a/erp24/config/web.php +++ b/erp24/config/web.php @@ -42,8 +42,8 @@ $config = [ ], 'queue' => [ 'class' => Queue::class, - // 'dsn' => 'amqp://admin:3qqHK2MRgGgxUdVT61@rabbitmq-yii_erp24:5672', - 'dsn' => 'amqp://admin:3qqHK2MRgGgxUdVT61@localhost:5672', + 'dsn' => 'amqp://admin:3qqHK2MRgGgxUdVT61@rabbitmq-yii_erp24:5672', + //'dsn' => 'amqp://admin:3qqHK2MRgGgxUdVT61@localhost:5672', 'queueName' => 'telegram-queue', 'as log' => \yii\queue\LogBehavior::class, 'ttr' => 300, // Время для выполнения задания @@ -55,6 +55,7 @@ $config = [ ], 'cache' => [ 'class' => 'yii\caching\FileCache', + 'cachePath' => '@yii_app/runtime/cache', ], 'user' => [ 'identityClass' => \yii_app\records\Admin::class, // 'app\models\User', 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,