sql_db: do not require network object
This commit is contained in:
@@ -19,9 +19,9 @@ def sql(func):
|
||||
|
||||
class SqlDB(Logger):
|
||||
|
||||
def __init__(self, network, path, commit_interval=None):
|
||||
def __init__(self, asyncio_loop, path, commit_interval=None):
|
||||
Logger.__init__(self)
|
||||
self.network = network
|
||||
self.asyncio_loop = asyncio_loop
|
||||
self.path = path
|
||||
self.commit_interval = commit_interval
|
||||
self.db_requests = queue.Queue()
|
||||
@@ -34,7 +34,7 @@ class SqlDB(Logger):
|
||||
self.logger.info("Creating database")
|
||||
self.create_database()
|
||||
i = 0
|
||||
while self.network.asyncio_loop.is_running():
|
||||
while self.asyncio_loop.is_running():
|
||||
try:
|
||||
future, func, args, kwargs = self.db_requests.get(timeout=0.1)
|
||||
except queue.Empty:
|
||||
|
||||
Reference in New Issue
Block a user