diff --git a/async_substrate_interface/async_substrate.py b/async_substrate_interface/async_substrate.py index 97aa604..177e0e2 100644 --- a/async_substrate_interface/async_substrate.py +++ b/async_substrate_interface/async_substrate.py @@ -2001,7 +2001,6 @@ async def result_handler( if subscription_result is not None: reached = True - logger.info("REACHED!") # Handler returned end result: unsubscribe from further updates async with self.ws as ws: await ws.unsubscribe( diff --git a/async_substrate_interface/utils/cache.py b/async_substrate_interface/utils/cache.py index 1b235e2..431a430 100644 --- a/async_substrate_interface/utils/cache.py +++ b/async_substrate_interface/utils/cache.py @@ -61,6 +61,7 @@ async def _create_if_not_exists(self, chain: str, table_name: str): ); """ ) + await self._db.commit() await self._db.execute( f""" CREATE TRIGGER IF NOT EXISTS prune_rows_trigger_{table_name} AFTER INSERT ON {table_name} @@ -82,8 +83,8 @@ async def __call__(self, chain, other_self, func, args, kwargs) -> Optional[Any] if not self._db: _ensure_dir() self._db = await aiosqlite.connect(CACHE_LOCATION) - table_name = _get_table_name(func) - local_chain = await self._create_if_not_exists(chain, table_name) + table_name = _get_table_name(func) + local_chain = await self._create_if_not_exists(chain, table_name) key = pickle.dumps((args, kwargs or None)) try: cursor: aiosqlite.Cursor = await self._db.execute(