Remove shared memory and write-ahead log files when dropping SQLite database

Since 6837a618f53d SQLite may create such temporary files.

Closes #13794
This commit is contained in:
Cédric Krier
2025-01-05 16:12:14 +01:00
parent d4493f0a53
commit ec6f30318b
+8 -2
View File
@@ -596,8 +596,14 @@ class Database(DatabaseInterface):
return
if os.sep in database_name:
return
os.remove(os.path.join(config.get('database', 'path'),
database_name + '.sqlite'))
file = os.path.join(
config.get('database', 'path'), database_name + '.sqlite')
os.remove(file)
for suffix in ['-shm', '-wal']:
try:
os.remove(file + suffix)
except FileNotFoundError:
pass
def list(self, hostname=None):
res = []