diff --git a/bridgev2/bridge.go b/bridgev2/bridge.go index bef0c79c..05a67b6a 100644 --- a/bridgev2/bridge.go +++ b/bridgev2/bridge.go @@ -55,7 +55,7 @@ type Bridge struct { wakeupBackfillQueue chan struct{} stopBackfillQueue *exsync.Event - backgroundCtx context.Context + BackgroundCtx context.Context cancelBackgroundCtx context.CancelFunc } @@ -170,8 +170,8 @@ func (br *Bridge) RunOnce(ctx context.Context, loginID networkid.UserLoginID, pa func (br *Bridge) StartConnectors(ctx context.Context) error { br.Log.Info().Msg("Starting bridge") - if br.backgroundCtx == nil || br.backgroundCtx.Err() != nil { - br.backgroundCtx, br.cancelBackgroundCtx = context.WithCancel(context.Background()) + if br.BackgroundCtx == nil || br.BackgroundCtx.Err() != nil { + br.BackgroundCtx, br.cancelBackgroundCtx = context.WithCancel(context.Background()) } if !br.ExternallyManagedDB { diff --git a/bridgev2/portal.go b/bridgev2/portal.go index a7ca5995..63081f57 100644 --- a/bridgev2/portal.go +++ b/bridgev2/portal.go @@ -375,7 +375,7 @@ func (portal *Portal) getEventCtxWithLog(rawEvt any, idx int) context.Context { case *portalCreateEvent: return evt.ctx } - return logWith.Logger().WithContext(portal.Bridge.backgroundCtx) + return logWith.Logger().WithContext(portal.Bridge.BackgroundCtx) } func (portal *Portal) handleSingleEvent(ctx context.Context, rawEvt any, doneCallback func()) {