Fix for holdoff threshold checks (#7795)

- Don't use the "day" portion of date?
This commit is contained in:
Oliver 2024-08-02 21:16:05 +10:00 committed by GitHub
parent 6f67fb2c9a
commit 6fd5a9941b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -118,7 +118,7 @@ def check_daily_holdoff(task_name: str, n_days: int = 1) -> bool:
if last_success: if last_success:
threshold = datetime.now() - timedelta(days=n_days) threshold = datetime.now() - timedelta(days=n_days)
if last_success > threshold: if last_success.date() > threshold.date():
logger.info( logger.info(
"Last successful run for '%s' was too recent - skipping task", task_name "Last successful run for '%s' was too recent - skipping task", task_name
) )