Skip to content

Commit

Permalink
Allow creating state queue for websocket bridges without status endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Jul 22, 2023
1 parent 23de526 commit ab9d6e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bridge/bridgestate.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ type BridgeStateQueue struct {
}

func (br *Bridge) NewBridgeStateQueue(user status.BridgeStateFiller) *BridgeStateQueue {
if len(br.Config.Homeserver.StatusEndpoint) == 0 {
if len(br.Config.Homeserver.StatusEndpoint) == 0 && !br.Websocket {
return nil
}
bsq := &BridgeStateQueue{
Expand Down
2 changes: 2 additions & 0 deletions bridge/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ func (br *Bridge) startWebsocket(wg *sync.WaitGroup) {
err := br.SendBridgeState(ctx, br.latestState)
if err != nil {
log.Err(err).Msg("Failed to resend latest bridge state after websocket reconnect")
} else {
log.Debug().Any("bridge_state", br.latestState).Msg("Resent bridge state after websocket reconnect")
}
}()
}
Expand Down

0 comments on commit ab9d6e5

Please sign in to comment.