Skip to content

Commit 19110f1

Browse files
committed
[fix/connection/tasks] Ignore current task instance when checking active tasks - #1204
The _is_update_in_progress function was incorrectly detecting the current Celery task as another running task, causing update_config to exit early. This fix excludes the current task by comparing task IDs, ensuring only other instances for the same device are considered. Added tests to cover same worker (should not skip) and different worker (should skip) scenarios. Fixes #1204
1 parent cf7966b commit 19110f1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

openwisp_controller/connection/tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def _is_update_in_progress(device_id):
2020
active = current_app.control.inspect().active()
2121
if not active:
2222
return False
23-
current_task_id = getattr(current_task, 'request', None)
23+
current_task_id = getattr(current_task, "request", None)
2424
if current_task_id:
2525
current_task_id = current_task_id.id
2626
else:

0 commit comments

Comments
 (0)