feng-tao closed pull request #4197: [AIRFLOW-3348] update run statistics on
dag refresh
URL: https://github.com/apache/incubator-airflow/pull/4197
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/airflow/www/views.py b/airflow/www/views.py
index 67c31bb9b1..8792191e21 100644
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -1877,6 +1877,8 @@ def refresh(self, session=None):
session.merge(orm_dag)
session.commit()
+ models.DagStat.update([dag_id], session=session, dirty_only=False)
+
dagbag.get_dag(dag_id)
flash("DAG [{}] is now fresh as a daisy".format(dag_id))
return redirect(request.referrer)
diff --git a/airflow/www_rbac/views.py b/airflow/www_rbac/views.py
index 29e8da1b9c..1825e15000 100644
--- a/airflow/www_rbac/views.py
+++ b/airflow/www_rbac/views.py
@@ -1627,6 +1627,8 @@ def refresh(self, session=None):
# sync dag permission
appbuilder.sm.sync_perm_for_dag(dag_id)
+ models.DagStat.update([dag_id], session=session, dirty_only=False)
+
dagbag.get_dag(dag_id)
flash("DAG [{}] is now fresh as a daisy".format(dag_id))
return redirect(request.referrer)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services