diff --git a/fedn/fedn/network/api/interface.py b/fedn/fedn/network/api/interface.py index 0821ed176..e56462493 100644 --- a/fedn/fedn/network/api/interface.py +++ b/fedn/fedn/network/api/interface.py @@ -2,6 +2,7 @@ import copy import os import threading +import uuid from io import BytesIO from flask import jsonify, send_from_directory @@ -863,7 +864,7 @@ def start_session( # Setup session config session_config = { - "session_id": session_id, + "session_id": session_id if session_id else str(uuid.uuid4()), "round_timeout": round_timeout, "buffer_size": round_buffer_size, "model_id": model_id, diff --git a/fedn/fedn/network/controller/controlbase.py b/fedn/fedn/network/controller/controlbase.py index 08766b69b..fab6a2027 100644 --- a/fedn/fedn/network/controller/controlbase.py +++ b/fedn/fedn/network/controller/controlbase.py @@ -203,7 +203,7 @@ def create_session(self, config): session_id = uuid.uuid4() config["session_id"] = str(session_id) else: - session_id = config["session_id"] if config["session_id"] else uuid.uuid4() + session_id = config["session_id"] self.tracer.create_session(id=session_id) self.tracer.set_session_config(session_id, config)