diff --git a/fedn/fedn/network/api/client.py b/fedn/fedn/network/api/client.py index 0e0a48a52..58fc27304 100644 --- a/fedn/fedn/network/api/client.py +++ b/fedn/fedn/network/api/client.py @@ -1,5 +1,3 @@ -import uuid - import requests __all__ = ['APIClient'] @@ -137,9 +135,6 @@ def start_session(self, session_id=None, round_timeout=180, rounds=5, round_buff :return: A dict with success or failure message and session config. :rtype: dict """ - # If session id is None, generate a random session id. - if session_id is None: - session_id = str(uuid.uuid4()) response = requests.post(self._get_url('start_session'), json={ 'session_id': session_id, 'round_timeout': round_timeout, 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,