Browse Source
Apply suggestions from code review
Co-authored-by: Tulir Asokan <tulir@maunium.net>
michaelkaye/respect_rate_limits
Michael Kaye
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
services/rssbot/rssbot.go
|
|
@ -418,7 +418,7 @@ func (s *Service) sendToRooms(cli types.MatrixClient, feedURL string, feed *gofe |
|
|
|
logger.Info("Sending new feed item") |
|
|
|
for _, roomID := range s.Feeds[feedURL].Rooms { |
|
|
|
if _, err := cli.SendMessageEvent(roomID, mevt.EventMessage, itemToHTML(feed, item)); err != nil { |
|
|
|
if err.Code == 429 { |
|
|
|
if httpErr, ok := err.(mautrix.HTTPError); ok && httpErr.IsStatus(429) { |
|
|
|
return err |
|
|
|
} else { |
|
|
|
logger.WithError(err).WithField("room_id", roomID).Error("Failed to send to room") |
|
|
|
xxxxxxxxxx