fix query over live error - getQueryData should wait for centrifuge to initialize (#43880)

This commit is contained in:
Artur Wierzbicki authored and GitHub committed 2022-01-11 10:07:08 +04:00
1 parent 6b70e1af76
commit 3ca3b7f432
2 files changed
+5 -1

No files matched your search

@@ -209,6 +209,9 @@ export class CentrifugeService implements CentrifugeSrv {
* Since the initial request and subscription are on the same socket, this will support HA setups
*/
getQueryData: CentrifugeSrv['getQueryData'] = async (options) => {
if (!this.centrifuge.isConnected()) {
await this.connectionBlocker;
}
return this.centrifuge.namedRPC('grafana.query', options.body);
};
@@ -143,7 +143,8 @@ export function runRequest(
}),
// handle errors
catchError((err) => {
console.error('runRequest.catchError', err);
const errLog = typeof err === 'string' ? err : JSON.stringify(err);
console.error('runRequest.catchError', errLog);
return of({
...state.panelData,
state: LoadingState.Error,