diff --git a/fedn/fedn/network/storage/statestore/mongostatestore.py b/fedn/fedn/network/storage/statestore/mongostatestore.py index 2e9207a56..2e5220b6c 100644 --- a/fedn/fedn/network/storage/statestore/mongostatestore.py +++ b/fedn/fedn/network/storage/statestore/mongostatestore.py @@ -808,9 +808,8 @@ 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 @@ -818,7 +817,7 @@ def update_client_status(self, client_name, status): :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)