mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
bridgev2/bridgestate: actually call unknown error reconnect
Some checks failed
Some checks failed
This commit is contained in:
parent
21e6cb0b9b
commit
26ca4cc75b
1 changed files with 4 additions and 2 deletions
|
|
@ -145,11 +145,10 @@ func (bsq *BridgeStateQueue) unknownErrorReconnect(triggeredBy status.BridgeStat
|
|||
if triggeredBy.Timestamp != prev.Timestamp {
|
||||
log.Debug().Msg("Not reconnecting as a new bridge state was sent after the unknown error")
|
||||
return
|
||||
} else if prev.Timestamp != prevUnsent.Timestamp {
|
||||
} else if len(bsq.ch) > 0 {
|
||||
log.Warn().Msg("Not reconnecting as there are unsent bridge states")
|
||||
return
|
||||
} else if prevUnsent.StateEvent != status.StateUnknownError || prev.StateEvent != status.StateUnknownError {
|
||||
// This case will probably never be hit
|
||||
log.Debug().Msg("Not reconnecting as the previous state was not an unknown error")
|
||||
return
|
||||
}
|
||||
|
|
@ -194,6 +193,9 @@ func (bsq *BridgeStateQueue) immediateSendBridgeState(state status.BridgeState)
|
|||
Msg("Not sending bridge state as it's a duplicate")
|
||||
return
|
||||
}
|
||||
if state.StateEvent == status.StateUnknownError {
|
||||
go bsq.unknownErrorReconnect(state)
|
||||
}
|
||||
|
||||
ctx := bsq.login.Log.WithContext(context.Background())
|
||||
bsq.sendNotice(ctx, state)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue