diff --git a/package.json b/package.json index 4d0f0c9a75..61a2337663 100644 --- a/package.json +++ b/package.json @@ -1092,8 +1092,8 @@ }, "docker.explorerRefreshInterval": { "type": "number", - "default": 1000, - "description": "Explorer refresh interval, default is 1000ms" + "default": 2000, + "description": "Explorer refresh interval, default is 2000ms" }, "docker.containers.groupBy": { "type": "string", diff --git a/src/tree/LocalRootTreeItemBase.ts b/src/tree/LocalRootTreeItemBase.ts index bb44a6de1a..c87a843fcf 100644 --- a/src/tree/LocalRootTreeItemBase.ts +++ b/src/tree/LocalRootTreeItemBase.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See LICENSE.md in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ConfigurationChangeEvent, ConfigurationTarget, TreeView, TreeViewVisibilityChangeEvent, workspace, WorkspaceConfiguration } from "vscode"; +import { ConfigurationChangeEvent, ConfigurationTarget, TreeView, TreeViewVisibilityChangeEvent, window, workspace, WorkspaceConfiguration } from "vscode"; import { AzExtParentTreeItem, AzExtTreeItem, AzureWizard, GenericTreeItem, IActionContext, InvalidTreeItem, registerEvent } from "vscode-azureextensionui"; import { configPrefix } from "../constants"; import { ext } from "../extensionVariables"; @@ -74,10 +74,10 @@ export abstract class LocalRootTreeItemBase('explorerRefreshInterval', 1000); + const refreshInterval: number = configOptions.get('explorerRefreshInterval', 2000); intervalId = setInterval( async () => { - if (await this.hasChanged()) { + if (window.state.focused && await this.hasChanged()) { await this.refresh(); } },