Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/SK-582 | If session id is empty it should be set to guid #488

Merged
merged 2 commits into from
Nov 17, 2023
Merged
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
5 changes: 0 additions & 5 deletions fedn/fedn/network/api/client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import uuid

import requests

__all__ = ['APIClient']
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion fedn/fedn/network/api/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import copy
import os
import threading
import uuid
from io import BytesIO

from flask import jsonify, send_from_directory
Expand Down Expand Up @@ -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,
Expand Down
Loading