From d8493acc13283a473eecac76f24ff0230f0c09f2 Mon Sep 17 00:00:00 2001 From: fomichev Date: Thu, 3 Jul 2025 09:51:31 +0300 Subject: [PATCH] =?utf8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20=D0=B2=20?= =?utf8?q?=D0=BB=D0=BE=D0=B3=D0=B8=D0=BA=D0=B5=20=D0=B7=D0=B0=D0=BF=D1=80?= =?utf8?q?=D0=BE=D1=80=D1=81=D0=BE=D0=B2=20=D1=81=D1=82=D0=B0=D1=82=D1=83?= =?utf8?q?=D1=81=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/controllers/CategoryPlanController.php | 2 +- erp24/web/js/category-plan/index.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/erp24/controllers/CategoryPlanController.php b/erp24/controllers/CategoryPlanController.php index a88d549c..275fcf75 100644 --- a/erp24/controllers/CategoryPlanController.php +++ b/erp24/controllers/CategoryPlanController.php @@ -655,7 +655,7 @@ class CategoryPlanController extends Controller { ->limit(1) ->one(); $task = json_decode($scriptLauncherLog->context, true ); - if (!$task) { + if (!$task || $scriptLauncherLog->active == 0) { return $this->asJson(['status' => 'not_found']); } diff --git a/erp24/web/js/category-plan/index.js b/erp24/web/js/category-plan/index.js index 651ddbc3..a613d116 100644 --- a/erp24/web/js/category-plan/index.js +++ b/erp24/web/js/category-plan/index.js @@ -274,6 +274,10 @@ function startTaskPolling() { $('#changes-count').hide(); $('#categoryPlan').addClass('block_table'); } + if (data.status === 'not_found') { + clearInterval(taskPollInterval); + taskPollInterval = null; + } if (data.status === 'done') { clearInterval(taskPollInterval); taskPollInterval = null; -- 2.39.5