feat: devmode removes the persist file after successful restore
This commit is contained in:
6
via.go
6
via.go
@@ -244,7 +244,10 @@ func (v *V) devModeRestore() {
|
|||||||
p := filepath.Join(".via", "devmode", "ctx.json")
|
p := filepath.Join(".via", "devmode", "ctx.json")
|
||||||
file, err := os.Open(p)
|
file, err := os.Open(p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
v.logWarn(nil, "devmode could not restore ctx from file: %v", err)
|
if os.IsNotExist(err) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
v.logErr(nil, "devmode could not restore ctx from file: %v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
@@ -265,6 +268,7 @@ func (v *V) devModeRestore() {
|
|||||||
v.registerCtx(c)
|
v.registerCtx(c)
|
||||||
}
|
}
|
||||||
v.logDebug(nil, "devmode restored ctx registry")
|
v.logDebug(nil, "devmode restored ctx registry")
|
||||||
|
os.Remove(p)
|
||||||
}
|
}
|
||||||
|
|
||||||
// New creates a new *V application with default configuration.
|
// New creates a new *V application with default configuration.
|
||||||
|
|||||||
Reference in New Issue
Block a user