Graph: Workaround for DashboardQueryRunner race condition (#36254)

* Graph: Workaround for DashboardQueryRunner race condition

* Removed deepClone
This commit is contained in:
Torkel Ödegaard
2021-06-30 10:36:05 +02:00
committed by GitHub
parent f9fb5ba637
commit 6f38883583
2 changed files with 4 additions and 8 deletions

View File

@@ -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;

View File

@@ -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));
}