Skip to content

Commit

Permalink
revert ResetBootstrapState removal on app termination since closing t…
Browse files Browse the repository at this point in the history
…he db explicitly enforces checkout and clearing the side-car wal file
  • Loading branch information
ganigeorgiev committed Dec 9, 2023
1 parent 646f90e commit b9f391c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
})
Expand Down
2 changes: 2 additions & 0 deletions pocketbase.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
}

Expand Down

0 comments on commit b9f391c

Please sign in to comment.