mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
bridgev2: expose background context
Some checks failed
Some checks failed
This commit is contained in:
parent
23d91b64cb
commit
a0191c8f58
2 changed files with 4 additions and 4 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue