forked from LBRYCommunity/lbry-sdk
fix ordering
This commit is contained in:
parent
8c605864e7
commit
1f64275da1
1 changed files with 3 additions and 4 deletions
|
@ -2,7 +2,6 @@ import os
|
||||||
import ssl
|
import ssl
|
||||||
import math
|
import math
|
||||||
import time
|
import time
|
||||||
import json
|
|
||||||
import base64
|
import base64
|
||||||
import codecs
|
import codecs
|
||||||
import typing
|
import typing
|
||||||
|
@ -567,7 +566,7 @@ class SessionManager:
|
||||||
async def serve_requests(self):
|
async def serve_requests(self):
|
||||||
async def consumer():
|
async def consumer():
|
||||||
while True:
|
while True:
|
||||||
_, fut = await self.priority_queue.get()
|
_, _, fut = await self.priority_queue.get()
|
||||||
try:
|
try:
|
||||||
await fut
|
await fut
|
||||||
except asyncio.CancelledError:
|
except asyncio.CancelledError:
|
||||||
|
@ -896,9 +895,9 @@ class LBRYElectrumX(SessionBase):
|
||||||
def schedule_requests(self, requests):
|
def schedule_requests(self, requests):
|
||||||
for request in requests:
|
for request in requests:
|
||||||
current = time.perf_counter()
|
current = time.perf_counter()
|
||||||
elapsed = current - self.last_request_received_at
|
elapsed = (1 << 65) - current - self.last_request_received_at
|
||||||
self.last_request_received_at = current
|
self.last_request_received_at = current
|
||||||
self.session_mgr.priority_queue.put_nowait((elapsed, self._handle_request(request)))
|
self.session_mgr.priority_queue.put_nowait((elapsed, id(request), self._handle_request(request)))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def protocol_min_max_strings(cls):
|
def protocol_min_max_strings(cls):
|
||||||
|
|
Loading…
Reference in a new issue