Open komuw opened 5 years ago
this fixes it;
diff --git a/wiji/worker.py b/wiji/worker.py
index 4a0f08d..1e2aa7b 100644
--- a/wiji/worker.py
+++ b/wiji/worker.py
@@ -158,7 +158,10 @@ class Worker:
monotonic_start = time.monotonic()
process_time_start = time.process_time()
try:
- return_value = await self.the_task.run(*task_args, **task_kwargs)
+ import copy
+
+ tt = copy.deepcopy(self.the_task)
+ return_value = await tt.run(*task_args, **task_kwargs)
if self.the_task.the_chain and not self.the_task._RETRYING:
# enqueue the chained task using the return_value
await self.the_task.the_chain.delay(return_value)
the bug exists