Skip to content

Commit

Permalink
update from master
Browse files Browse the repository at this point in the history
  • Loading branch information
Wrede committed Dec 7, 2023
1 parent 495699d commit bf471e3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions fedn/fedn/network/storage/statestore/mongostatestore.py
Original file line number Diff line number Diff line change
Expand Up @@ -808,17 +808,16 @@ def set_round_data(self, round_id, round_data):
self.rounds.update_one({'round_id': round_id}, {
'$set': {'round_data': round_data}}, True)

def update_client_status(self, client_name, status):
"""Update client status in statestore.
def update_client_status(self, clients, status):
""" Update client status in statestore.
:param client_name: The client name
:type client_name: str
:param status: The client status
:type status: str
:return: None
"""
datetime_now = datetime.now()
filter_query = {"name": client_name}
filter_query = {"name": {"$in": clients}}

update_query = {"$set": {"last_seen": datetime_now, "status": status}}
self.clients.update_one(filter_query, update_query)
self.clients.update_many(filter_query, update_query)

0 comments on commit bf471e3

Please sign in to comment.