mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-24 14:08:45 +00:00
Fix session handling for refresh job (#9636)
Co-authored-by: NiharDoshi99 <51595473+NiharDoshi99@users.noreply.github.com>
This commit is contained in:
parent
1d81d16ac0
commit
567a62f7db
@ -15,6 +15,7 @@ from pathlib import Path
|
||||
from typing import Dict
|
||||
|
||||
from airflow import DAG, settings
|
||||
from airflow.jobs.scheduler_job import SchedulerJob
|
||||
from airflow.models import DagModel
|
||||
from jinja2 import Template
|
||||
from openmetadata_managed_apis.api.config import (
|
||||
@ -142,18 +143,18 @@ class DagDeployer:
|
||||
.first()
|
||||
)
|
||||
logger.info("dag_model:" + str(dag_model))
|
||||
# Scheduler Job to scan dags
|
||||
scan_dags_job_background()
|
||||
|
||||
return ApiResponse.success(
|
||||
{"message": f"Workflow [{self.dag_id}] has been created"}
|
||||
)
|
||||
except Exception as exc:
|
||||
msg = f"Workflow [{self.dag_id}] failed to refresh due to [{exc}]"
|
||||
logger.debug(traceback.format_exc())
|
||||
logger.error(msg)
|
||||
return ApiResponse.server_error({f"message": msg})
|
||||
|
||||
scan_dags_job_background()
|
||||
|
||||
return ApiResponse.success(
|
||||
{"message": f"Workflow [{self.dag_id}] has been created"}
|
||||
)
|
||||
|
||||
def deploy(self):
|
||||
"""
|
||||
Run all methods to deploy the DAG
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user