Skip to content

Commit

Permalink
Add some more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Jul 21, 2021
1 parent b3e76c3 commit 419e137
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rss/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ async def _send(self, feed: Feed, entry: Entry, sub: Subscription) -> EventID:
self.log.warning(f"Failed to send {entry.id} of {feed.id} to {sub.room_id}: {e}")

async def _broadcast(self, feed: Feed, entry: Entry, subscriptions: List[Subscription]) -> None:
self.log.debug(f"Broadcasting {entry.id} of {feed.id}")
spam_sleep = self.config["spam_sleep"]
tasks = [self._send(feed, entry, sub) for sub in subscriptions]
if spam_sleep >= 0:
Expand All @@ -128,9 +129,11 @@ async def _poll_once(self) -> None:
next_retry_delay = self.config["update_interval"] * 60 * error_count
next_retry_delay = min(next_retry_delay, self.config["max_backoff"] * 60)
next_retry = int(time() + next_retry_delay)
self.log.debug(f"Setting backoff of {feed.id} to {error_count} / {next_retry}")
self.db.set_backoff(feed, error_count, next_retry)
continue
elif feed.error_count > 0:
self.log.debug(f"Resetting backoff of {feed.id}")
self.db.set_backoff(feed, error_count=0, next_retry=0)
try:
new_entries = {entry.id: entry for entry in entries}
Expand Down

0 comments on commit 419e137

Please sign in to comment.