From a03ccb32ce2a7437ffc8ef79a539e4e29bb6293e Mon Sep 17 00:00:00 2001
From: Maxim Podosochnyy <podosochnyy@perx.ru>
Date: Wed, 29 Nov 2023 19:18:50 +0700
Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0?=
 =?UTF-8?q?=D1=86=D0=B8=D1=8F=20ExtensionService=20=D1=81=20=D1=83=D1=87?=
 =?UTF-8?q?=D1=91=D1=82=D0=BE=D0=BC=20long=20polling=20=D0=BE=D0=BF=D0=B5?=
 =?UTF-8?q?=D1=80=D0=B0=D1=86=D0=B8=D0=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 perxis/extensions/extension_service.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/perxis/extensions/extension_service.py b/perxis/extensions/extension_service.py
index 664d11e..6da5bfb 100644
--- a/perxis/extensions/extension_service.py
+++ b/perxis/extensions/extension_service.py
@@ -121,6 +121,13 @@ class ExtensionService(
         now = datetime.datetime.now()
 
         for operation_meta in self.__operations.values():
+            task_is_not_running = operation_meta.task.done() or operation_meta.task.cancelled()
+
+            # Если task фактически не работает то операцию нужно пометить как выполненную. Это может произойти в случае
+            # неотловленного исключения, например
+            if task_is_not_running:
+                operation_meta.was_finished = True
+
             if not operation_meta.was_finished:
                 continue
 
-- 
GitLab