From 6053b1c3cfde42e22088bceab9bdf0710625649c Mon Sep 17 00:00:00 2001 From: jsjiang Date: Fri, 1 Nov 2024 11:51:33 -0700 Subject: [PATCH] reset last_id for next time range --- ezidapp/management/commands/proc-cleanup-async-queues_v2.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ezidapp/management/commands/proc-cleanup-async-queues_v2.py b/ezidapp/management/commands/proc-cleanup-async-queues_v2.py index 7d52ad5c..c04fd1c0 100644 --- a/ezidapp/management/commands/proc-cleanup-async-queues_v2.py +++ b/ezidapp/management/commands/proc-cleanup-async-queues_v2.py @@ -173,8 +173,9 @@ def run(self): log.info(f"Finished - Checking ref Ids: {time_range_str}") exit() else: - log.info(f"Sleep {ASYNC_CLEANUP_SLEEP} seconds before processing next batch") + log.info(f"Sleep {ASYNC_CLEANUP_SLEEP} seconds before processing next time range.") self.sleep(ASYNC_CLEANUP_SLEEP) + last_id = 0 min_age_ts = max_age_ts max_age_ts = min_age_ts + ASYNC_CLEANUP_SLEEP time_range = Q(updateTime__gte=min_age_ts) & Q(updateTime__lte=max_age_ts)