mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-09-09 08:00:47 +02:00
[#7836] fixed migration logs write deadlock and added app.ClearBootstrap/OnClearBootstrap helpers
This commit is contained in:
+9
-1
@@ -37,9 +37,9 @@ func (t *TestApp) Cleanup() {
|
||||
event.App = t
|
||||
|
||||
t.OnTerminate().Trigger(event, func(e *core.TerminateEvent) error {
|
||||
t.ClearBootstrap()
|
||||
t.TestMailer.Reset()
|
||||
t.ResetEventCalls()
|
||||
t.ResetBootstrapState()
|
||||
|
||||
return e.Next()
|
||||
})
|
||||
@@ -144,6 +144,14 @@ func NewTestAppWithConfig(config core.BaseAppConfig) (*TestApp, error) {
|
||||
Priority: -99999,
|
||||
})
|
||||
|
||||
t.OnClearBootstrap().Bind(&hook.Handler[*core.BootstrapEvent]{
|
||||
Func: func(e *core.BootstrapEvent) error {
|
||||
t.registerEventCall("OnClearBootstrap")
|
||||
return e.Next()
|
||||
},
|
||||
Priority: -99999,
|
||||
})
|
||||
|
||||
t.OnServe().Bind(&hook.Handler[*core.ServeEvent]{
|
||||
Func: func(e *core.ServeEvent) error {
|
||||
t.registerEventCall("OnServe")
|
||||
|
||||
Reference in New Issue
Block a user