diff --git a/package.json b/package.json index 56ecbf5..744a066 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "properties": { "osc-viewer.refreshConsoleLogs.interval": { "type": "integer", - "default": "5", + "default": 30, "description": "Interval in seconds to refresh console logs." }, "osc-viewer.refreshConsoleLogs.enabled": { diff --git a/src/virtual_filesystem/logs.ts b/src/virtual_filesystem/logs.ts index ce6f024..d61f14b 100644 --- a/src/virtual_filesystem/logs.ts +++ b/src/virtual_filesystem/logs.ts @@ -25,10 +25,15 @@ export class LogsProvider implements vscode.TextDocumentContentProvider { const conf = vscode.workspace.getConfiguration('osc-viewer'); const hasParameter = conf.has("refreshConsoleLogs.enabled"); if (!hasParameter || (hasParameter && conf.get("refreshConsoleLogs.enabled"))) { + const interval = conf.get("refreshConsoleLogs.interval"); + let intervalNumber = 30; + if (typeof interval === 'number') { + intervalNumber = interval; + } this.clock$ = new Observable((subject) => { setInterval(() => { subject.next(); - }, conf.get("refreshConsoleLogs.interval")); + }, 1000 * intervalNumber); }); this.clock$.subscribe(() => { for (const uri of this._documents.keys()) {