Skip to content

Commit

Permalink
Adiciona max_retries e retry_delay em get_raw_ftp (#694)
Browse files Browse the repository at this point in the history
* Adiciona max_retries e retry_delay em get_raw_ftp

* corrige retry_delay

* adiciona CHANGELOG.md

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
vtr363 and mergify[bot] authored May 28, 2024
1 parent daf46be commit 2fa2060
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions pipelines/rj_smtr/veiculo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 5 additions & 2 deletions pipelines/rj_smtr/veiculo/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 2fa2060

Please sign in to comment.