WIP: root background loops at context.Background() (refs #97)
Some checks failed
check / check (push) Failing after 1m2s
Some checks failed
check / check (push) Failing after 1m2s
Incomplete: tests pass but three lint findings remain (funcorder on registerHooks, unparam in engine_integration_test.go). Committed to preserve work in progress; to be amended into a single clean commit.
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"go.uber.org/fx"
|
||||
"gorm.io/gorm"
|
||||
"sneak.berlin/go/webhooker/internal/database"
|
||||
)
|
||||
@@ -189,8 +190,16 @@ func (e *Engine) ExportRecoverInFlight(
|
||||
}
|
||||
|
||||
// ExportStart exposes start for testing.
|
||||
func (e *Engine) ExportStart(ctx context.Context) {
|
||||
e.start(ctx)
|
||||
func (e *Engine) ExportStart() {
|
||||
e.start()
|
||||
}
|
||||
|
||||
// ExportRegisterHooks registers the engine's real fx lifecycle
|
||||
// hooks on a lifecycle supplied by a test, so a test can drive
|
||||
// the exact OnStart/OnStop functions the application runs and
|
||||
// hand OnStart the kind of context fx actually supplies.
|
||||
func (e *Engine) ExportRegisterHooks(lc fx.Lifecycle) {
|
||||
e.registerHooks(lc)
|
||||
}
|
||||
|
||||
// ExportStop exposes stop for testing.
|
||||
|
||||
Reference in New Issue
Block a user