[#7305] fixed deadlock when manually triggering the OnTerminate hook

Co-authored-by: Felix <FelixM@yer.tools>
This commit is contained in:
Gani Georgiev
2025-11-07 17:00:42 +02:00
parent 41607679a0
commit fcb5b5dd67
4 changed files with 30 additions and 6 deletions

View File

@@ -205,6 +205,8 @@ func (pb *PocketBase) Execute() error {
<-done
// trigger cleanups
//
// @todo consider skipping and just call the finalizer in case OnTerminate was already invoked manually?
event := new(core.TerminateEvent)
event.App = pb
return pb.OnTerminate().Trigger(event, func(e *core.TerminateEvent) error {