Skip to content

Commit

Permalink
altera get_db_object
Browse files Browse the repository at this point in the history
  • Loading branch information
akaBotelho committed Oct 3, 2024
1 parent b4ce077 commit 16c3bed
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions pipelines/serpro/tasks.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# -*- coding: utf-8 -*-
import csv
import os
from datetime import datetime, timedelta
from datetime import datetime
from pathlib import Path
from time import sleep

from prefect import task

from pipelines.serpro.constants import constants
from pipelines.utils.jdbc import JDBC
from pipelines.utils.secret import get_secret
from pipelines.utils.utils import log


Expand All @@ -18,13 +16,8 @@ def wait_sleeping(interval_seconds: int = 54000):
sleep(interval_seconds)


@task(checkpoint=False, max_retries=3, retry_delay=timedelta(seconds=20))
@task(checkpoint=False)
def get_db_object(secret_path="radar_serpro", environment: str = "dev"):
jar_path = get_secret(secret_path=secret_path, environment=environment)["jars"]

if not os.path.exists(jar_path):
raise Exception(f"Arquivo JAR '{jar_path}' não encontrado.")

return JDBC(db_params_secret_path=secret_path, environment=environment)


Expand Down

0 comments on commit 16c3bed

Please sign in to comment.