ruff
This commit is contained in:
parent
9a5af434e4
commit
31280471c9
1 changed files with 5 additions and 4 deletions
|
|
@ -51,7 +51,9 @@ class KuzuAdapter(GraphDBInterface):
|
||||||
self.connection: Optional[Connection] = None
|
self.connection: Optional[Connection] = None
|
||||||
self.executor = ThreadPoolExecutor()
|
self.executor = ThreadPoolExecutor()
|
||||||
if cache_config.caching:
|
if cache_config.caching:
|
||||||
self.redis_lock = get_cache_engine(lock_key="kuzu-lock-" + str(uuid5(NAMESPACE_OID, db_path)))
|
self.redis_lock = get_cache_engine(
|
||||||
|
lock_key="kuzu-lock-" + str(uuid5(NAMESPACE_OID, db_path))
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
self._initialize_connection()
|
self._initialize_connection()
|
||||||
self.KUZU_ASYNC_LOCK = asyncio.Lock()
|
self.KUZU_ASYNC_LOCK = asyncio.Lock()
|
||||||
|
|
@ -230,7 +232,6 @@ class KuzuAdapter(GraphDBInterface):
|
||||||
self.reopen()
|
self.reopen()
|
||||||
logger.info(f"Open connections after open: {self.open_connections}")
|
logger.info(f"Open connections after open: {self.open_connections}")
|
||||||
|
|
||||||
|
|
||||||
result = await loop.run_in_executor(self.executor, blocking_query)
|
result = await loop.run_in_executor(self.executor, blocking_query)
|
||||||
|
|
||||||
if not cache_config.caching:
|
if not cache_config.caching:
|
||||||
|
|
@ -238,7 +239,7 @@ class KuzuAdapter(GraphDBInterface):
|
||||||
self.open_connections -= 1
|
self.open_connections -= 1
|
||||||
logger.info(f"Opened connections after closing {self.open_connections}")
|
logger.info(f"Opened connections after closing {self.open_connections}")
|
||||||
if self.open_connections == 0:
|
if self.open_connections == 0:
|
||||||
self.connection.execute('CHECKPOINT;')
|
self.connection.execute("CHECKPOINT;")
|
||||||
self.close()
|
self.close()
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
@ -1905,4 +1906,4 @@ class KuzuAdapter(GraphDBInterface):
|
||||||
time_nodes = await self.query(cypher)
|
time_nodes = await self.query(cypher)
|
||||||
time_ids_list = [item[0] for item in time_nodes]
|
time_ids_list = [item[0] for item in time_nodes]
|
||||||
|
|
||||||
return ", ".join(f"'{uid}'" for uid in time_ids_list)
|
return ", ".join(f"'{uid}'" for uid in time_ids_list)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue