1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-03-17 21:27:52 +02:00

revert ResetBootstrapState removal on app termination since closing the db explicitly enforces checkout and clearing the side-car wal file

This commit is contained in:
Gani Georgiev 2023-12-09 19:43:03 +02:00
parent 646f90ef43
commit b9f391cf85
2 changed files with 5 additions and 1 deletions

View File

@ -557,8 +557,10 @@ func (app *BaseApp) Restart() error {
App: app,
IsRestart: true,
}, func(e *TerminateEvent) error {
e.App.ResetBootstrapState()
// attempt to restart the bootstrap process in case execve returns an error for some reason
defer app.Bootstrap()
defer e.App.Bootstrap()
return syscall.Exec(execPath, os.Args, os.Environ())
})

View File

@ -169,6 +169,8 @@ func (pb *PocketBase) Execute() error {
// trigger cleanups
return pb.OnTerminate().Trigger(&core.TerminateEvent{
App: pb,
}, func(e *core.TerminateEvent) error {
return e.App.ResetBootstrapState()
})
}