1
0

ln gossip: run sig checks in a thread

to avoid blocking the asyncio event loop
This commit is contained in:
SomberNight
2021-03-15 20:37:49 +01:00
parent cedc71a8e3
commit dca182992f
2 changed files with 22 additions and 20 deletions

View File

@@ -13,7 +13,7 @@ def sql(func):
"""wrapper for sql methods"""
def wrapper(self: 'SqlDB', *args, **kwargs):
assert threading.currentThread() != self.sql_thread
f = asyncio.Future()
f = self.asyncio_loop.create_future()
self.db_requests.put((f, func, args, kwargs))
return f
return wrapper