You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/08/13 16:00:14 UTC

[GitHub] [airflow] andrewgodwin commented on a change in pull request #17601: Fix triggerer query where limit is not supported in some DB versions

andrewgodwin commented on a change in pull request #17601:
URL: https://github.com/apache/airflow/pull/17601#discussion_r688621109



##########
File path: airflow/triggers/temporal.py
##########
@@ -54,7 +54,8 @@ async def run(self):
         unexpectedly, or handles a DST change poorly.
         """
         # Sleep an hour at a time while it's more than 2 hours away
-        while (self.moment - timezone.utcnow()).total_hours() > 2:
+        hours_until_moment = (self.moment - timezone.utcnow()).total_seconds() / 3600

Review comment:
       You can't move this out of the loop - it will only evaluate once and then you have the risk of an infinite loop. It needs to evaluate in the loop's guard directly.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org