Web.poll_feed_task: tighten last_polled_feed check to only if the task param is greater

for #1712
pull/1716/head
Ryan Barrett 2025-01-21 17:51:46 -08:00
rodzic 35bd39298c
commit cc9c7d5226
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
2 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -2493,7 +2493,7 @@ class WebTest(TestCase):
got = self.post('/queue/poll-feed', data={
'domain': 'user.com',
'last_polled': (NOW + timedelta(minutes=1)).isoformat(),
'last_polled': (NOW - timedelta(minutes=1)).isoformat(),
})
self.assertEqual(204, got.status_code)
self.assertEqual(NOW, self.user.key.get().last_polled_feed)

2
web.py
Wyświetl plik

@ -883,7 +883,7 @@ def poll_feed_task():
logger.info(f'Last poll: {user.last_polled_feed}')
last_polled = request.form.get('last_polled')
if (last_polled and user.last_polled_feed
and last_polled != user.last_polled_feed.isoformat()):
and last_polled < user.last_polled_feed.isoformat()):
logger.warning('duplicate poll feed task! deferring to other task')
return '', 204