Skip to content

Commit

Permalink
atualiza filtro data
Browse files Browse the repository at this point in the history
  • Loading branch information
eng-rodrigocunha committed Oct 11, 2023
1 parent 82f54e6 commit c9d8f21
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pipelines/rj_smtr/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c9d8f21

Please sign in to comment.