Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openwisp_controller/connection/base/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def update_config(self):
self.connector_instance.update_config()
except Exception as e:
logger.exception(e)
else:
finally:
self.disconnect()

def save(self, *args, **kwargs):
Expand Down
3 changes: 2 additions & 1 deletion openwisp_controller/connection/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ def _is_update_in_progress(device_id, current_task_id=None):
active = current_app.control.inspect().active()
if not active:
return False
device_id_str = str(device_id)
# check if there's any other running task before adding it
# exclude the current task by comparing task IDs
for task_list in active.values():
for task in task_list:
if (
task["name"] == _TASK_NAME
and str(device_id) in task["args"]
and device_id_str in [str(arg) for arg in task.get("args", [])]
and task["id"] != current_task_id
):
return True
Expand Down
Loading