From c9d8f210f6b18e7395f0a1f460ad158325600978 Mon Sep 17 00:00:00 2001 From: eng-rodrigocunha Date: Tue, 10 Oct 2023 22:09:27 -0300 Subject: [PATCH] atualiza filtro data --- pipelines/rj_smtr/tasks.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pipelines/rj_smtr/tasks.py b/pipelines/rj_smtr/tasks.py index 8fa352642..6928ff841 100644 --- a/pipelines/rj_smtr/tasks.py +++ b/pipelines/rj_smtr/tasks.py @@ -989,10 +989,17 @@ def get_recapture_timestamps( dates = dates.strftime("%Y-%m-%d").to_list() for date in dates: - datetime_filter = datetime.now(tz=timezone(constants.TIMEZONE.value)).replace( + datetime_filter = datetime.fromisoformat(f"{date} 23:59:00").replace( second=0, microsecond=0 ) + # Round down to the nearest interval_minutes minutes + datetime_filter = datetime_filter.replace( + minute=(datetime_filter.minute // interval_minutes) * interval_minutes + ) + + datetime_filter = datetime_filter.strftime("%Y-%m-%d %H:%M:%S") + if datetime_filter > current_timestamp: flag_break = True