From c185b31b1cf42d6189c31c90f4885e984a4ae68f Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 10 Apr 2021 14:20:55 +0300 Subject: [PATCH] Fix incorrect use of time() --- maubot.yaml | 2 +- rss/bot.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/maubot.yaml b/maubot.yaml index e226e69..2e08f6f 100644 --- a/maubot.yaml +++ b/maubot.yaml @@ -1,6 +1,6 @@ maubot: 0.1.0 id: xyz.maubot.rss -version: 0.2.4 +version: 0.2.5 license: AGPL-3.0-or-later modules: - rss diff --git a/rss/bot.py b/rss/bot.py index 85343fd..20b76d2 100644 --- a/rss/bot.py +++ b/rss/bot.py @@ -18,7 +18,6 @@ from time import mktime, time from string import Template import asyncio -import time import aiohttp import hashlib @@ -112,7 +111,7 @@ async def _poll_once(self) -> None: subs = self.db.get_feeds() if not subs: return - now = int(time.time()) + now = int(time()) tasks = [self.try_parse_feed(feed=feed) for feed in subs if feed.next_retry < now] feed: Feed entries: Iterable[Entry] @@ -122,7 +121,7 @@ async def _poll_once(self) -> None: error_count = feed.error_count + 1 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.time() + next_retry_delay) + next_retry = int(time() + next_retry_delay) self.db.set_backoff(feed, error_count, next_retry) continue elif feed.error_count > 0: