Skip to content

Commit 8d8319d

Browse files
committed
Fixed an issue where the initial delay was being ignored
1 parent 96101bc commit 8d8319d

9 files changed

+27
-17
lines changed

dist/exceptionless.js

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.node.js

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.node.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ExceptionlessClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ export class ExceptionlessClient {
3232
this.config = new Configuration({ apiKey: <string>settingsOrApiKey, serverUrl: serverUrl });
3333
}
3434

35+
this.updateSettingsTimer(5000);
3536
this.config.onChanged((config) => this.updateSettingsTimer(this._timeoutId > 0 ? 5000 : 0));
3637
this.config.queue.onEventsPosted((events, response) => this.updateSettingsTimer());
37-
this.updateSettingsTimer(5000);
3838
}
3939

4040
public createException(exception: Error): EventBuilder {
@@ -217,7 +217,7 @@ export class ExceptionlessClient {
217217
}
218218

219219
private updateSettingsTimer(initialDelay?: number) {
220-
this.config.log.info('Updating settings timer');
220+
this.config.log.info(`Updating settings timer with delay: ${initialDelay}`);
221221

222222
this._timeoutId = clearTimeout(this._timeoutId);
223223
this._timeoutId = clearInterval(this._intervalId);

src/configuration/Configuration.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,11 @@ export class Configuration implements IConfigurationSettings {
230230
* @param value
231231
*/
232232
public set updateSettingsWhenIdleInterval(value: number) {
233-
if (typeof value !== 'number' || value <= 0) {
233+
if (typeof value !== 'number') {
234+
return;
235+
}
236+
237+
if (value <= 0) {
234238
value = -1;
235239
} else if (value > 0 && value < 15000) {
236240
value = 15000;

src/configuration/SettingsManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export class SettingsManager {
9191

9292
config.storage.settings.save(newSettings);
9393

94-
config.log.info('Updated settings');
94+
config.log.info(`Updated settings: v${newSettings.version}`);
9595
this.changed(config);
9696
});
9797
}

0 commit comments

Comments
 (0)