Make sure the override works with pubdash

This commit is contained in:
Michael Mandrus
2023-01-27 14:36:10 -05:00
parent 6f7c9f614b
commit 609d595b4b
@@ -243,6 +243,7 @@ func groupQueriesByPanelId(dashboard *simplejson.Json) map[int64][]*simplejson.J
var panelQueries []*simplejson.Json
cacheTTLOverride := panel.Get("queryCachingTTL").MustInt64(0)
for _, queryObj := range panel.Get("targets").MustArray() {
query := simplejson.NewFromAny(queryObj)
@@ -257,6 +258,10 @@ func groupQueriesByPanelId(dashboard *simplejson.Json) map[int64][]*simplejson.J
query.Set("datasource", datasource)
}
if cacheTTLOverride > 0 {
query.Set("queryCachingTTL", cacheTTLOverride)
}
panelQueries = append(panelQueries, query)
}
}