mirror of
https://github.com/status-im/status-go.git
synced 2025-01-12 15:45:07 +00:00
fix: closing tmp db file after creation
Changes done in this commit solve the " The process cannot access the file because it is being used by another process." error which was noticeable on Windows while migrating a profile keypair to a Keycard.
This commit is contained in:
parent
9c0526f7d9
commit
db2f0e6f31
@ -1090,10 +1090,14 @@ func (b *GethStatusBackend) createTempDBFile(pattern string) (tmpDbPath string,
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = file.Close()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
tmpDbPath = file.Name()
|
||||
cleanup = func() {
|
||||
filePath := file.Name()
|
||||
_ = file.Close()
|
||||
_ = os.Remove(filePath)
|
||||
_ = os.Remove(filePath + "-wal")
|
||||
_ = os.Remove(filePath + "-shm")
|
||||
|
Loading…
x
Reference in New Issue
Block a user