1
0

daemon/wallet/network: make stop() methods async

This commit is contained in:
SomberNight
2021-03-09 17:52:36 +01:00
parent ce88b36e81
commit 3c019c2f9c
15 changed files with 123 additions and 70 deletions

View File

@@ -25,6 +25,7 @@ class SqlDB(Logger):
Logger.__init__(self)
self.asyncio_loop = asyncio_loop
self.stopping = False
self.stopped_event = asyncio.Event()
self.path = path
test_read_write_permissions(path)
self.commit_interval = commit_interval
@@ -65,6 +66,8 @@ class SqlDB(Logger):
# write
self.conn.commit()
self.conn.close()
self.asyncio_loop.call_soon_threadsafe(self.stopped_event.set)
self.logger.info("SQL thread terminated")
def create_database(self):