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

This commit is contained in:
Artur Wierzbicki 2022-01-11 10:07:08 +04:00 committed by GitHub
parent 6b70e1af76
commit 3ca3b7f432
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

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

View File

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