[AIRFLOW-2776] Compress tree view JSON
The tree view generates JSON that can be massive for bigger DAGs, up to 10s of MBs. The JSON is currently prettified, which both takes up more CPU time during serialization, and slows down everything else that uses it. Considering the JSON is only meant to be used programmatically, this is an easy win Closes #3620 from abdul-stripe/smaller-tree-view- json
This commit is contained in:
Родитель
4cd72b91bd
Коммит
68535d1886
|
@ -1477,7 +1477,8 @@ class Airflow(BaseView):
|
|||
for d in dates],
|
||||
}
|
||||
|
||||
data = json.dumps(data, indent=4, default=json_ser)
|
||||
# minimize whitespace as this can be huge for bigger dags
|
||||
data = json.dumps(data, default=json_ser, separators=(',', ':'))
|
||||
session.commit()
|
||||
|
||||
form = DateTimeWithNumRunsForm(data={'base_date': max_date,
|
||||
|
|
|
@ -1208,7 +1208,8 @@ class Airflow(AirflowBaseView):
|
|||
for d in dates],
|
||||
}
|
||||
|
||||
data = json.dumps(data, indent=4, default=json_ser)
|
||||
# minimize whitespace as this can be huge for bigger dags
|
||||
data = json.dumps(data, default=json_ser, separators=(',', ':'))
|
||||
session.commit()
|
||||
|
||||
form = DateTimeWithNumRunsForm(data={'base_date': max_date,
|
||||
|
|
Загрузка…
Ссылка в новой задаче