Esempio n. 1
0
 def sync_to_db(self):
     """
     Save attributes about list of DAG to the DB.
     """
     # To avoid circular import - airflow.models.dagbag -> airflow.models.dag -> airflow.models.dagbag
     from airflow.models.dag import DAG
     from airflow.models.serialized_dag import SerializedDagModel
     DAG.bulk_sync_to_db(self.dags.values())
     if self.store_serialized_dags:
         SerializedDagModel.bulk_sync_to_db(self.dags.values())
Esempio n. 2
0
 def sync_to_db(self):
     """
     Save attributes about list of DAG to the DB.
     """
     # To avoid circular import - airflow.models.dagbag -> airflow.models.dag -> airflow.models.dagbag
     from airflow.models.dag import DAG
     from airflow.models.serialized_dag import SerializedDagModel
     self.log.debug("Calling the DAG.bulk_sync_to_db method")
     DAG.bulk_sync_to_db(self.dags.values())
     # Write Serialized DAGs to DB if DAG Serialization is turned on
     # Even though self.read_dags_from_db is False
     if settings.STORE_SERIALIZED_DAGS:
         self.log.debug("Calling the SerializedDagModel.bulk_sync_to_db method")
         SerializedDagModel.bulk_sync_to_db(self.dags.values())
 def sync_to_db(self):
     """
     Save attributes about list of DAG to the DB.
     """
     from airflow.models.dag import DAG
     DAG.bulk_sync_to_db(self.dags.values())