Skip to content

Commit

Permalink
Fix incorrect use of time()
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Apr 10, 2021
1 parent 5efba56 commit c185b31
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion maubot.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 2 additions & 3 deletions rss/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from time import mktime, time
from string import Template
import asyncio
import time

import aiohttp
import hashlib
Expand Down Expand Up @@ -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]
Expand All @@ -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:
Expand Down

0 comments on commit c185b31

Please sign in to comment.