diff --git a/pipelines/rj_smtr/veiculo/CHANGELOG.md b/pipelines/rj_smtr/veiculo/CHANGELOG.md index 741876b45..4058be5ea 100644 --- a/pipelines/rj_smtr/veiculo/CHANGELOG.md +++ b/pipelines/rj_smtr/veiculo/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog - veiculo +## [1.0.1] - 2024-05-28 + +### Adicionado + +- Adiciona retry a task `get_raw_ftp` para mitigar as falhas na captura (https://github.com/prefeitura-rio/pipelines/pull/694) + ## [1.0.0] - 2024-04-25 ### Alterado diff --git a/pipelines/rj_smtr/veiculo/tasks.py b/pipelines/rj_smtr/veiculo/tasks.py index 74f07ca57..c21b094a2 100644 --- a/pipelines/rj_smtr/veiculo/tasks.py +++ b/pipelines/rj_smtr/veiculo/tasks.py @@ -5,7 +5,7 @@ import traceback import zipfile import io -from datetime import datetime +from datetime import datetime, timedelta import pandas as pd import numpy as np from prefect import task @@ -246,7 +246,10 @@ def pre_treatment_sppo_infracao(status: dict, timestamp: datetime): return {"data": data, "error": error} -@task +@task( + max_retries=constants.MAX_RETRIES.value, + retry_delay=timedelta(seconds=constants.RETRY_DELAY.value), +) def get_raw_ftp( ftp_path: str, filetype: str,