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 {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
err = file.Close()
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
tmpDbPath = file.Name()
|
tmpDbPath = file.Name()
|
||||||
cleanup = func() {
|
cleanup = func() {
|
||||||
filePath := file.Name()
|
filePath := file.Name()
|
||||||
_ = file.Close()
|
|
||||||
_ = os.Remove(filePath)
|
_ = os.Remove(filePath)
|
||||||
_ = os.Remove(filePath + "-wal")
|
_ = os.Remove(filePath + "-wal")
|
||||||
_ = os.Remove(filePath + "-shm")
|
_ = os.Remove(filePath + "-shm")
|
||||||
|
|
Loading…
Reference in New Issue