Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adiciona max_retries e retry_delay em get_raw_ftp #694

Merged
merged 4 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading