mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-08 17:24:01 -05:00
Batch messages on the exthost to not freeze ads (#8949)
* batch messages on the exthost to not freeze ads * clear out messages on query complete
This commit is contained in:
@@ -142,9 +142,10 @@ export class InsightsDialogController {
|
||||
this._errorMessageService.showDialog(Severity.Error, nls.localize("insightsError", "Insights error"), error);
|
||||
});
|
||||
});
|
||||
queryRunner.onMessage(message => {
|
||||
if (message.isError) {
|
||||
this._errorMessageService.showDialog(Severity.Error, nls.localize("insightsError", "Insights error"), message.message);
|
||||
queryRunner.onMessage(messages => {
|
||||
const errorMessage = messages.find(m => m.isError);
|
||||
if (errorMessage) {
|
||||
this._errorMessageService.showDialog(Severity.Error, nls.localize("insightsError", "Insights error"), errorMessage.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { InsightsDialogController } from 'sql/workbench/services/insights/browser/insightsDialogController';
|
||||
import QueryRunner from 'sql/workbench/services/query/common/queryRunner';
|
||||
import QueryRunner, { IQueryMessage } from 'sql/workbench/services/query/common/queryRunner';
|
||||
import { ConnectionManagementService } from 'sql/workbench/services/connection/browser/connectionManagementService';
|
||||
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
|
||||
|
||||
@@ -112,7 +112,7 @@ function getPrimedQueryRunner(data: string[][], columns: string[]): IPrimedQuery
|
||||
const emitter = new Emitter<string>();
|
||||
const querymock = Mock.ofType(QueryRunner, MockBehavior.Strict);
|
||||
querymock.setup(x => x.onQueryEnd).returns(x => emitter.event);
|
||||
querymock.setup(x => x.onMessage).returns(x => new Emitter<azdata.IResultMessage>().event);
|
||||
querymock.setup(x => x.onMessage).returns(x => new Emitter<[IQueryMessage]>().event);
|
||||
querymock.setup(x => x.batchSets).returns(x => {
|
||||
return <Array<azdata.BatchSummary>>[
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user