Tweak remote question fetching

This commit is contained in:
Thomas Sileo 2019-07-07 17:50:28 +02:00
parent e24da84985
commit 2657e4a139

View file

@ -64,6 +64,8 @@ class Tasks:
dt = parser.parse(question.closed or question.endTime).astimezone(timezone.utc) dt = parser.parse(question.closed or question.endTime).astimezone(timezone.utc)
minutes = int((dt - now).total_seconds() / 60) minutes = int((dt - now).total_seconds() / 60)
p.push( if minutes > 0:
question.id, "/task/fetch_remote_question", delay=minutes # Only push the task if the poll is not ended yet
) # XXX: delay expects minutes p.push(
question.id, "/task/fetch_remote_question", delay=minutes
) # XXX: delay expects minutes