Add some more logs

This commit is contained in:
Tulir Asokan 2021-07-21 18:19:13 +03:00
parent b3e76c338e
commit 419e137848

View File

@ -104,6 +104,7 @@ class RSSBot(Plugin):
self.log.warning(f"Failed to send {entry.id} of {feed.id} to {sub.room_id}: {e}") 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: 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"] spam_sleep = self.config["spam_sleep"]
tasks = [self._send(feed, entry, sub) for sub in subscriptions] tasks = [self._send(feed, entry, sub) for sub in subscriptions]
if spam_sleep >= 0: if spam_sleep >= 0:
@ -128,9 +129,11 @@ class RSSBot(Plugin):
next_retry_delay = self.config["update_interval"] * 60 * error_count next_retry_delay = self.config["update_interval"] * 60 * error_count
next_retry_delay = min(next_retry_delay, self.config["max_backoff"] * 60) next_retry_delay = min(next_retry_delay, self.config["max_backoff"] * 60)
next_retry = int(time() + next_retry_delay) 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) self.db.set_backoff(feed, error_count, next_retry)
continue continue
elif feed.error_count > 0: 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) self.db.set_backoff(feed, error_count=0, next_retry=0)
try: try:
new_entries = {entry.id: entry for entry in entries} new_entries = {entry.id: entry for entry in entries}