mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Graph: Workaround for DashboardQueryRunner race condition (#36254)
* Graph: Workaround for DashboardQueryRunner race condition * Removed deepClone
This commit is contained in:
@@ -20,11 +20,12 @@ import { PanelQueryRunner } from '../query/state/PanelQueryRunner';
|
||||
|
||||
class MetricsPanelCtrl extends PanelCtrl {
|
||||
declare datasource: DataSourceApi;
|
||||
declare range: TimeRange;
|
||||
|
||||
contextSrv: ContextSrv;
|
||||
datasourceSrv: any;
|
||||
timeSrv: any;
|
||||
templateSrv: any;
|
||||
declare range: TimeRange;
|
||||
interval: any;
|
||||
intervalMs: any;
|
||||
resolution: any;
|
||||
@@ -98,7 +99,6 @@ class MetricsPanelCtrl extends PanelCtrl {
|
||||
// load datasource service
|
||||
return this.datasourceSrv
|
||||
.get(this.panel.datasource, this.panel.scopedVars)
|
||||
.then(this.updateTimeRange.bind(this))
|
||||
.then(this.issueQueries.bind(this))
|
||||
.catch((err: any) => {
|
||||
this.processDataError(err);
|
||||
@@ -178,11 +178,11 @@ class MetricsPanelCtrl extends PanelCtrl {
|
||||
const newTimeData = applyPanelTimeOverrides(this.panel, this.range);
|
||||
this.timeInfo = newTimeData.timeInfo;
|
||||
this.range = newTimeData.timeRange;
|
||||
|
||||
return this.datasource;
|
||||
}
|
||||
|
||||
issueQueries(datasource: DataSourceApi) {
|
||||
this.updateTimeRange(datasource);
|
||||
|
||||
this.datasource = datasource;
|
||||
|
||||
const panel = this.panel as PanelModel;
|
||||
|
||||
@@ -184,10 +184,6 @@ export class GraphCtrl extends MetricsPanelCtrl {
|
||||
actions.push({ text: 'Toggle legend', click: 'ctrl.toggleLegend()', shortcut: 'p l' });
|
||||
}
|
||||
|
||||
issueQueries(datasource: any) {
|
||||
return super.issueQueries(datasource);
|
||||
}
|
||||
|
||||
zoomOut(evt: any) {
|
||||
appEvents.publish(new ZoomOutEvent(2));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user