From ee59295d1924e798661e4ceb88a401c89f4df013 Mon Sep 17 00:00:00 2001 From: tricktx Date: Fri, 16 Aug 2024 10:13:59 -0300 Subject: [PATCH] [fix] add max_retries in crawl_cno --- pipelines/datasets/br_rf_cno/tasks.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pipelines/datasets/br_rf_cno/tasks.py b/pipelines/datasets/br_rf_cno/tasks.py index 3aeefb3e7..7f362ac66 100644 --- a/pipelines/datasets/br_rf_cno/tasks.py +++ b/pipelines/datasets/br_rf_cno/tasks.py @@ -2,7 +2,8 @@ """ Tasks for br_rf_cno """ - +from datetime import datetime, timedelta +from pipelines.constants import constants import os from bs4 import BeautifulSoup from datetime import datetime @@ -106,7 +107,10 @@ def wrangling(input_dir: str, output_dir: str, partition_date: str) -> None: log('----- Wrangling completed') -@task +@task( + max_retries=5, + retry_delay=timedelta(seconds=constants.TASK_RETRY_DELAY.value), +) def crawl_cno(root: str, url: str) -> None: """ Downloads and unpacks a ZIP file from the given URL.