zephyring commented on code in PR #25239:
URL: https://github.com/apache/superset/pull/25239#discussion_r1324908729
##########
superset/tasks/cron_util.py:
##########
@@ -39,9 +39,9 @@ def cron_schedule_window(cron: str, timezone: str) ->
Iterator[datetime]:
logger.warning("Timezone %s was invalid. Falling back to 'UTC'",
timezone)
utc = pytz_timezone("UTC")
# convert the current time to the user's local time for comparison
- time_now = time_now.astimezone(tz)
- start_at = time_now - timedelta(seconds=1)
- stop_at = time_now + timedelta(seconds=window_size)
+ time_now = triggered_at.astimezone(tz)
+ start_at = time_now - timedelta(seconds=window_size / 2)
+ stop_at = time_now + timedelta(seconds=window_size / 2)
Review Comment:
you're right. Cron is at minute level. and `stop_at` compares to
triggered_at 😂
##########
superset/tasks/cron_util.py:
##########
@@ -39,9 +39,9 @@ def cron_schedule_window(cron: str, timezone: str) ->
Iterator[datetime]:
logger.warning("Timezone %s was invalid. Falling back to 'UTC'",
timezone)
utc = pytz_timezone("UTC")
# convert the current time to the user's local time for comparison
- time_now = time_now.astimezone(tz)
- start_at = time_now - timedelta(seconds=1)
- stop_at = time_now + timedelta(seconds=window_size)
+ time_now = triggered_at.astimezone(tz)
+ start_at = time_now - timedelta(seconds=window_size / 2)
+ stop_at = time_now + timedelta(seconds=window_size / 2)
Review Comment:
you're right. Cron is at minute level. and `stop_at` compares to
triggered_at 😂
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]