@@ -154,21 +154,20 @@ def close(self) -> None:
154154"""
155155
156156
157- def connect_db (db_file : str , sync_off : bool = False ) -> sqlite3 .Connection :
157+ def connect_db (db_file : str ) -> sqlite3 .Connection :
158158 import sqlite3 .dbapi2
159159
160160 db = sqlite3 .dbapi2 .connect (db_file , check_same_thread = False )
161- if sync_off :
162- # This is a bit unfortunate (as we may get corrupt cache after e.g. Ctrl + C),
163- # but without this flag, commits are *very* slow, especially when using HDDs,
164- # see https://www.sqlite.org/faq.html#q19 for details.
165- db .execute ("PRAGMA synchronous=OFF" )
161+ # This is a bit unfortunate (as we may get corrupt cache after e.g. Ctrl + C),
162+ # but without this flag, commits are *very* slow, especially when using HDDs,
163+ # see https://www.sqlite.org/faq.html#q19 for details.
164+ db .execute ("PRAGMA synchronous=OFF" )
166165 db .executescript (SCHEMA )
167166 return db
168167
169168
170169class SqliteMetadataStore (MetadataStore ):
171- def __init__ (self , cache_dir_prefix : str , sync_off : bool = False ) -> None :
170+ def __init__ (self , cache_dir_prefix : str ) -> None :
172171 # We check startswith instead of equality because the version
173172 # will have already been appended by the time the cache dir is
174173 # passed here.
@@ -177,7 +176,7 @@ def __init__(self, cache_dir_prefix: str, sync_off: bool = False) -> None:
177176 return
178177
179178 os .makedirs (cache_dir_prefix , exist_ok = True )
180- self .db = connect_db (os_path_join (cache_dir_prefix , "cache.db" ), sync_off = sync_off )
179+ self .db = connect_db (os_path_join (cache_dir_prefix , "cache.db" ))
181180
182181 def _query (self , name : str , field : str ) -> Any :
183182 # Raises FileNotFound for consistency with the file system version
0 commit comments