Skip to content

Queue timer fires even when api key isn't configured #121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions packages/core/src/ExceptionlessClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ export class ExceptionlessClient {
await SettingsManager.applySavedServerSettings(this.config);
}

if (!this.config.isValid) {
this.config.services.log.warn("Exceptionless is not configured and will not process events.");
return;
}

this.updateSettingsTimer(!!configurationOrApiKey);
await EventPluginManager.startup(new PluginContext(this));

Expand Down Expand Up @@ -63,19 +68,21 @@ export class ExceptionlessClient {
await this.config.services.queue.process();
}

private updateSettingsTimer(startingUp = false) {
private updateSettingsTimer(startingUp: boolean = false) {
this.suspendSettingsTimer();

if (!this.config.isValid) {
return;
}

const interval = this.config.updateSettingsWhenIdleInterval;
if (interval > 0) {
let initialDelay: number = interval;
if (startingUp) {
initialDelay = this.config.settingsVersion > 0 ? 15000 : 5000;
}

this.config.services.log.info(
`Update settings every ${interval}ms (${initialDelay || 0}ms delay)`,
);
this.config.services.log.info(`Update settings every ${interval}ms (${initialDelay || 0}ms delay)`);
// TODO: Look into better async scheduling..
const updateSettings = () =>
void SettingsManager.updateSettings(this.config);
Expand Down