mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
bridgev2/portal: run portal create background tasks without context cancellation
This commit is contained in:
parent
0088368066
commit
328bab41a3
1 changed files with 3 additions and 2 deletions
|
|
@ -3509,12 +3509,13 @@ func (portal *Portal) createMatrixRoomInLoop(ctx context.Context, source *UserLo
|
|||
}
|
||||
portal.Bridge.WakeupBackfillQueue()
|
||||
}
|
||||
withoutCancelCtx := context.WithoutCancel(ctx)
|
||||
if portal.Parent != nil {
|
||||
if portal.Parent.MXID != "" {
|
||||
portal.addToParentSpaceAndSave(ctx, true)
|
||||
} else {
|
||||
log.Info().Msg("Parent portal doesn't exist, creating in background")
|
||||
go portal.createParentAndAddToSpace(ctx, source)
|
||||
go portal.createParentAndAddToSpace(withoutCancelCtx, source)
|
||||
}
|
||||
}
|
||||
portal.updateUserLocalInfo(ctx, info.UserLocal, source, true)
|
||||
|
|
@ -3543,7 +3544,7 @@ func (portal *Portal) createMatrixRoomInLoop(ctx context.Context, source *UserLo
|
|||
login := portal.Bridge.GetCachedUserLoginByID(up.LoginID)
|
||||
if login != nil {
|
||||
login.inPortalCache.Remove(portal.PortalKey)
|
||||
go login.tryAddPortalToSpace(ctx, portal, up.CopyWithoutValues())
|
||||
go login.tryAddPortalToSpace(withoutCancelCtx, portal, up.CopyWithoutValues())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue