Skip to content

Commit

Permalink
Automatic reload: set default to 30 second and check type
Browse files Browse the repository at this point in the history
  • Loading branch information
outscale-mdr committed Oct 20, 2022
1 parent d1489ba commit d748d00
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
7 changes: 6 additions & 1 deletion src/virtual_filesystem/logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit d748d00

Please sign in to comment.