Compare commits

...

2 Commits

Author SHA1 Message Date
ValueRaider
c8d34863c1 better idea: check if table exists after init 2024-09-04 22:20:36 +01:00
ValueRaider
94eac4308b Cache: possible fix for 'no such table' 2024-09-04 22:13:42 +01:00

View File

@@ -153,6 +153,18 @@ class _TzCache:
db.create_tables([_KV])
else:
raise
# # Verify that the database file actually exists.
# # Maybe peewee silently failed to create file and
# # fellback to in-memory database:
# if not _os.path.exists(db.database):
# self.initialised = 0 # failure
# return
# Verify that the table was actually created
if not db.table_exists('_kv'):
self.initialised = 0 # failure
return
self.initialised = 1 # success
def lookup(self, key):