From 1d80ce24196a32576ca467b40f649e20b6c3bef9 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Wed, 13 Oct 2021 15:57:15 -0300 Subject: [PATCH] initialize new sessions with high priority --- 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 b7919b53e..8ec03889f 100644 --- a/lbry/wallet/server/session.py +++ b/lbry/wallet/server/session.py @@ -895,13 +895,13 @@ class LBRYElectrumX(SessionBase): self.daemon = self.session_mgr.daemon self.bp: BlockProcessor = self.session_mgr.bp self.db: LevelDB = self.bp.db - self.time_since_last_request = time.perf_counter() + self.last_request_received_at = 0 def schedule_requests(self, requests): for request in requests: current = time.perf_counter() - elapsed = current - self.time_since_last_request - self.time_since_last_request = current + elapsed = current - self.last_request_received_at + self.last_request_received_at = current self.session_mgr.priority_queue.put_nowait((elapsed, self._handle_request(request))) @classmethod