diff --git a/src/ota_metadata/file_table/_orm.py b/src/ota_metadata/file_table/_orm.py index ae7053d47..d684adc3a 100644 --- a/src/ota_metadata/file_table/_orm.py +++ b/src/ota_metadata/file_table/_orm.py @@ -66,11 +66,14 @@ def check_entry(self, **kv: Any) -> bool: where_cols=tuple(kv), ) - with self._con as conn: - _cur = conn.execute(_sql_stmt, kv) - _cur.row_factory = None - _res: tuple[int] = _cur.fetchone() - return _res[0] > 0 + def _inner(): + with self._con as conn: + _cur = conn.execute(_sql_stmt, kv) + _cur.row_factory = None + _res: tuple[int] = _cur.fetchone() + return _res[0] > 0 + + return self._pool.submit(_inner).result() class FileTableNonRegularFilesORM(ORMBase[FileTableNonRegularFiles]):