1
0

watchtower: watch new channels

This commit is contained in:
bitromortac
2021-09-27 10:31:44 +02:00
parent 11146d352f
commit ff61020dd2
4 changed files with 21 additions and 11 deletions

View File

@@ -1,5 +1,4 @@
import os
import concurrent
import queue
import threading
import asyncio
@@ -10,7 +9,10 @@ from .util import test_read_write_permissions
def sql(func):
"""wrapper for sql methods"""
"""wrapper for sql methods
returns an awaitable asyncio.Future
"""
def wrapper(self: 'SqlDB', *args, **kwargs):
assert threading.currentThread() != self.sql_thread
f = self.asyncio_loop.create_future()
@@ -20,7 +22,7 @@ def sql(func):
class SqlDB(Logger):
def __init__(self, asyncio_loop: asyncio.BaseEventLoop, path, commit_interval=None):
Logger.__init__(self)
self.asyncio_loop = asyncio_loop