From 7d3eef1fd9c3036e2efd38bc6958f0e46b195291 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Mon, 20 Sep 2021 14:42:47 -0400 Subject: [PATCH] fix logging number of notified sessions --- lbry/wallet/server/session.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lbry/wallet/server/session.py b/lbry/wallet/server/session.py index 003174267..6f97d7231 100644 --- a/lbry/wallet/server/session.py +++ b/lbry/wallet/server/session.py @@ -637,15 +637,15 @@ class SessionManager: if touched or (height_changed and self.mempool_statuses): notified_hashxs = 0 - notified_sessions = 0 + notified_sessions = set() to_notify = touched if height_changed else new_touched for hashX in to_notify: for session_id in self.hashx_subscriptions_by_session[hashX]: asyncio.create_task(self.sessions[session_id].send_history_notification(hashX)) - notified_sessions += 1 + notified_sessions.add(session_id) notified_hashxs += 1 if notified_sessions: - self.logger.info(f'notified {notified_sessions} sessions/{notified_hashxs:,d} touched addresses') + self.logger.info(f'notified {len(notified_sessions)} sessions/{notified_hashxs:,d} touched addresses') def add_session(self, session): self.sessions[id(session)] = session