Skip to content

Commit

Permalink
[hotfix] Aumenta tempo de espera para a próxima requisição (#584)
Browse files Browse the repository at this point in the history
* interrompe a requisição de dados quando o resultado é 0

* update agents de teste

* fix typo

* retorna agent de produção

* update posição da condicional

* wip

* alteração de agent

* retorna os agents de produção

* altera comentário para registrar flow novamente

* aumenta tempo de espera para próxiam requisição

* retira break desnecessário

* retorna gents após testes

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
lingsv and mergify[bot] authored Dec 1, 2023
1 parent 2c1792d commit 92164cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pipelines/rj_smtr/br_rj_riodejaneiro_recurso/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@

LABELS = get_current_flow_labels()

# Captura
# Captura dos dados #

with case(capture, True):
run_captura = create_flow_run(
Expand All @@ -116,7 +116,7 @@

wait_captura = merge(wait_captura_true, wait_captura_false)

# Recaptura
# Recaptura dos dados #

with case(recapture, True):
run_recaptura = create_flow_run(
Expand All @@ -140,7 +140,7 @@

wait_recaptura = merge(wait_recaptura_true, wait_recaptura_false)

# Materialização
# Materialização dos dados #

with case(materialize, True):
run_materializacao = create_flow_run(
Expand Down
4 changes: 2 additions & 2 deletions pipelines/rj_smtr/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,11 +866,11 @@ def get_raw_recursos(request_url: str, request_params: dict) -> tuple[str, str,

if len(paginated_data) == top:
skip += top
time.sleep(36)
time.sleep(60) # aumenta tempo de espera para não sobrecarregar a api
else:
if len(paginated_data) == 0:
log("Nenhum dado para tratar.")
break

all_records = True
data += paginated_data

Expand Down

0 comments on commit 92164cc

Please sign in to comment.