From 6fd5a9941b8cd50c9bc6275e4a96a58dc8dee4fc Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 2 Aug 2024 21:16:05 +1000 Subject: [PATCH] Fix for holdoff threshold checks (#7795) - Don't use the "day" portion of date? --- src/backend/InvenTree/InvenTree/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/InvenTree/InvenTree/tasks.py b/src/backend/InvenTree/InvenTree/tasks.py index d436581ae4..21195c9c75 100644 --- a/src/backend/InvenTree/InvenTree/tasks.py +++ b/src/backend/InvenTree/InvenTree/tasks.py @@ -118,7 +118,7 @@ def check_daily_holdoff(task_name: str, n_days: int = 1) -> bool: if last_success: threshold = datetime.now() - timedelta(days=n_days) - if last_success > threshold: + if last_success.date() > threshold.date(): logger.info( "Last successful run for '%s' was too recent - skipping task", task_name )