You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/04/06 06:11:40 UTC

[GitHub] [airflow] Fokko commented on a change in pull request #4922: [AIRFLOW-3844] Add foreign keys for task_instances and dag_runs to dag_model

Fokko commented on a change in pull request #4922: [AIRFLOW-3844] Add foreign keys for task_instances and dag_runs to dag_model
URL: https://github.com/apache/airflow/pull/4922#discussion_r272784838
 
 

 ##########
 File path: airflow/models/__init__.py
 ##########
 @@ -3090,6 +3099,8 @@ def __init__(
             'last_loaded',
         }
 
+        self.sync_to_db()
 
 Review comment:
   On second thoughts, this might not be the best idea. Currently the `sync_to_db()` is only invoked by the scheduler, on processing the files. Having this in the constructor would cause that also the webserver, and the workers would run this UPSERT. Therefore we would have to be more careful with the locking etc, possibly introduce race conditions etc.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services