diff --git a/.github/workflows/data_sync_microservice-docker-image.yml b/.github/workflows/data_sync_microservice-docker-image.yml index f42e9d5..8f59c23 100644 --- a/.github/workflows/data_sync_microservice-docker-image.yml +++ b/.github/workflows/data_sync_microservice-docker-image.yml @@ -1,4 +1,4 @@ -name: Build and Push Docker Image For Sigeca Data Export Microservice +name: Docker Image Deployment For Microservices on: push: diff --git a/sigeca_data_import_microservice/app/infrastructure/jdbc_reader.py b/sigeca_data_import_microservice/app/infrastructure/jdbc_reader.py index 485fbdc..781d99a 100644 --- a/sigeca_data_import_microservice/app/infrastructure/jdbc_reader.py +++ b/sigeca_data_import_microservice/app/infrastructure/jdbc_reader.py @@ -31,6 +31,7 @@ def __init__(self, config: Any): .getOrCreate() ) self.spark.sparkContext.setLogLevel(config.get("log_level", "WARN")) + self.tunnel = None def setup_ssh_tunnel(self): self.tunnel = SSHTunnelForwarder( diff --git a/sigeca_data_import_microservice/main.py b/sigeca_data_import_microservice/main.py index 619a612..fef4715 100644 --- a/sigeca_data_import_microservice/main.py +++ b/sigeca_data_import_microservice/main.py @@ -53,7 +53,7 @@ def _run_scheduler(sync_service, sync_interval_minutes): ProgramResourceRepository(jdbc_reader), ) try: - if config["jdbc_reader"]["ssh_user"]: + if config["jdbc_reader"].get("ssh_user"): jdbc_reader.setup_ssh_tunnel() lmis_client.login() @@ -71,5 +71,5 @@ def _run_scheduler(sync_service, sync_interval_minutes): except Exception as e: logging.exception(e) finally: - if config["jdbc_reader"]["ssh_user"]: + if config["jdbc_reader"].get("ssh_user"): jdbc_reader.close_ssh_tunnel()