Skip to content

Commit

Permalink
Fix a few things after merging.
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
  • Loading branch information
audetto committed Nov 16, 2023
1 parent a07c077 commit ef3a72d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions diskcache/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __repr__(self):
'eviction_policy': 'least-recently-stored',
'size_limit': 2**30, # 1gb
'cull_limit': 10,
'sqlite_query_only': 0,
'sqlite_query_only': 0,
'sqlite_auto_vacuum': 1, # FULL
'sqlite_cache_size': 2**13, # 8,192 pages
'sqlite_journal_mode': 'wal',
Expand Down Expand Up @@ -458,8 +458,8 @@ def __init__(self, directory=None, timeout=60, disk=Disk, **settings):
raise EnvironmentError(
error.errno,
'Cache directory "%s" does not exist'
' and could not be created' % self._directory
)
' and could not be created' % self._directory,
) from None

# The SQLite query_only pragma is a special case. Before the cache
# connection is opened, get the setting from keyword arguments.
Expand Down Expand Up @@ -520,13 +520,13 @@ def __init__(self, directory=None, timeout=60, disk=Disk, **settings):
else:
query = 'INSERT OR REPLACE INTO Settings VALUES (?, ?)'
sql(query, (key, value))
self.reset(key, value, update=(not self.sqlite_query_only))
self.reset(key, value, update=not self.sqlite_query_only)

for key, value in METADATA.items():
if not self.sqlite_query_only:
query = 'INSERT OR IGNORE INTO Settings VALUES (?, ?)'
sql(query, (key, value))
self.reset(key, update=(not self.sqlite_query_only))
self.reset(key, update=not self.sqlite_query_only)

((self._page_size,),) = sql('PRAGMA page_size').fetchall()

Expand Down

0 comments on commit ef3a72d

Please sign in to comment.