From aea0b534097dd4881aafb9e929cbc846febad846 Mon Sep 17 00:00:00 2001 From: Egor Fedorov Date: Thu, 26 Sep 2024 03:14:14 +0700 Subject: [PATCH 1/2] fix threading --- garcon/activity.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/garcon/activity.py b/garcon/activity.py index b64560b..772f164 100755 --- a/garcon/activity.py +++ b/garcon/activity.py @@ -537,13 +537,19 @@ def __init__(self, flow, activities=None): def run(self): """Run the activities. """ - + threads = [] for activity in self.activities: if (self.worker_activities and activity.name not in self.worker_activities): continue - threading.Thread(target=worker_runner, args=(activity,)).start() - + thread = threading.Thread( + target=worker_runner, + args=(activity,)) + thread.start() + threads.append(thread) + + for thread in threads: + thread.join() class ActivityState: """ From aa3d2b34bf95dbabfded86cc219d1c8296051f57 Mon Sep 17 00:00:00 2001 From: Egor Fedorov Date: Thu, 26 Sep 2024 10:31:49 +0700 Subject: [PATCH 2/2] fix threading --- garcon/activity.py | 1 + 1 file changed, 1 insertion(+) diff --git a/garcon/activity.py b/garcon/activity.py index 772f164..b9fe701 100755 --- a/garcon/activity.py +++ b/garcon/activity.py @@ -551,6 +551,7 @@ def run(self): for thread in threads: thread.join() + class ActivityState: """ Activity State