Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit 56c179d

Browse files
committed
[CBR-496] Fix --rebuild-db not rebuilding sqlite
The sqlite db is actually stored in a file and not a directory
1 parent a240bf2 commit 56c179d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

wallet-new/src/Cardano/Wallet/Kernel.hs

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import Data.Acid (AcidState, createArchive, createCheckpoint,
3131
openLocalStateFrom)
3232
import Data.Acid.Memory (openMemoryState)
3333
import qualified Data.Map.Strict as Map
34-
import System.Directory (doesDirectoryExist, removeDirectoryRecursive)
34+
import System.Directory (doesPathExist, removePathForcibly)
3535

3636
import Pos.Chain.Txp (TxAux (..))
3737
import Pos.Crypto (ProtocolMagic)
@@ -128,8 +128,8 @@ handlesOpen mode =
128128
UseFilePath (DatabaseOptions acidDb sqliteDb rebuildDB) -> do
129129
let deleteMaybe fp = do
130130
when rebuildDB $ do
131-
itsHere <- doesDirectoryExist fp
132-
when itsHere $ removeDirectoryRecursive fp
131+
itsHere <- doesPathExist fp
132+
when itsHere $ removePathForcibly fp
133133
deleteMaybe acidDb
134134
db <- openLocalStateFrom acidDb defDB
135135
deleteMaybe sqliteDb

0 commit comments

Comments
 (0)