mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-17 23:35:54 +01:00
feat - add product service and logging to throttling (#302469)
This commit is contained in:
@@ -18,6 +18,7 @@ import { IContextKeyService } from '../../../../platform/contextkey/common/conte
|
||||
import { IDialogService } from '../../../../platform/dialogs/common/dialogs.js';
|
||||
import { ILogService } from '../../../../platform/log/common/log.js';
|
||||
import { INativeHostService } from '../../../../platform/native/common/native.js';
|
||||
import { IProductService } from '../../../../platform/product/common/productService.js';
|
||||
import { IWorkspaceTrustRequestService } from '../../../../platform/workspace/common/workspaceTrust.js';
|
||||
import { WorkbenchPhase, registerWorkbenchContribution2 } from '../../../common/contributions.js';
|
||||
import { IViewsService } from '../../../services/views/common/viewsService.js';
|
||||
@@ -118,7 +119,9 @@ class ChatSuspendThrottlingHandler extends Disposable {
|
||||
|
||||
constructor(
|
||||
@INativeHostService nativeHostService: INativeHostService,
|
||||
@IChatService chatService: IChatService
|
||||
@IChatService chatService: IChatService,
|
||||
@IProductService productService: IProductService,
|
||||
@ILogService logService: ILogService,
|
||||
) {
|
||||
super();
|
||||
|
||||
@@ -129,6 +132,10 @@ class ChatSuspendThrottlingHandler extends Disposable {
|
||||
// throttling is not applied so that the chat session can continue
|
||||
// even when the window is not in focus.
|
||||
nativeHostService.setBackgroundThrottling(!running);
|
||||
|
||||
if (productService.quality === 'insider') { // TODO@bpasero remove me in the future
|
||||
logService.info(`[ChatSuspendThrottlingHandler] background throttling ${running ? 'suspended' : 'resumed'}`);
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user