mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-10-09 02:57:56 +00:00
core: remove .exported db files when database is removed (#7615)
Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
This commit is contained in:
co-authored by
Evgeny @ SimpleX Chat
parent
3d3dd421ff
commit
80f8757449
@@ -124,11 +124,13 @@ deleteStorage = do
|
||||
fs <- lift storageFiles
|
||||
liftIO $ closeDBStore `withStores` fs
|
||||
remove `withDBs` fs
|
||||
removeExported `withDBs` fs
|
||||
mapM_ removeDir $ filesPath fs
|
||||
mapM_ removeDir $ assetsPath fs
|
||||
mapM_ removeDir =<< chatReadVar tempDirectory
|
||||
where
|
||||
remove f = whenM (doesFileExist f) $ removeFile f
|
||||
removeExported f = remove $ f <> ".exported"
|
||||
removeDir d = whenM (doesDirectoryExist d) $ removePathForcibly d
|
||||
|
||||
data StorageFiles = StorageFiles
|
||||
|
||||
Reference in New Issue
Block a user