File tree Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -8,11 +8,9 @@ import { BrowserRequestInfoPlugin } from "./plugins/BrowserRequestInfoPlugin.js"
88import { BrowserWrapFunctions } from "./plugins/BrowserWrapFunctions.js" ;
99
1010export class BrowserExceptionlessClient extends ExceptionlessClient {
11- public async startup (
12- configurationOrApiKey ?: ( config : Configuration ) => void | string ,
13- ) : Promise < void > {
11+ public async startup ( configurationOrApiKey ?: ( config : Configuration ) => void | string ) : Promise < void > {
1412 const config = this . config ;
15- if ( configurationOrApiKey ) {
13+ if ( configurationOrApiKey && ! this . _initialized ) {
1614 config . useLocalStorage ( ) ;
1715
1816 config . addPlugin ( new BrowserGlobalHandlerPlugin ( ) ) ;
@@ -24,7 +22,7 @@ export class BrowserExceptionlessClient extends ExceptionlessClient {
2422 }
2523
2624 await super . startup ( configurationOrApiKey ) ;
27- if ( configurationOrApiKey ) {
25+ if ( configurationOrApiKey && ! this . _initialized ) {
2826 config . removePlugin ( new SimpleErrorPlugin ( ) ) ;
2927 }
3028 }
Original file line number Diff line number Diff line change @@ -11,12 +11,14 @@ import { PluginContext } from "./plugins/PluginContext.js";
1111export class ExceptionlessClient {
1212 private _intervalId = 0 ;
1313 private _timeoutId = 0 ;
14+ protected _initialized = false ;
1415
1516 public constructor ( public config : Configuration = new Configuration ( ) ) { }
1617
1718 /** Resume background submission, resume any timers. */
1819 public async startup ( configurationOrApiKey ?: ( config : Configuration ) => void | string ) : Promise < void > {
19- if ( configurationOrApiKey ) {
20+ if ( configurationOrApiKey && ! this . _initialized ) {
21+ this . _initialized = true ;
2022 EventPluginManager . addDefaultPlugins ( this . config ) ;
2123
2224 if ( typeof configurationOrApiKey === "string" ) {
@@ -33,6 +35,7 @@ export class ExceptionlessClient {
3335
3436 this . updateSettingsTimer ( ! ! configurationOrApiKey ) ;
3537 await EventPluginManager . startup ( new PluginContext ( this ) ) ;
38+
3639 const { queue } = this . config . services ;
3740 await queue . startup ( ) ;
3841 if ( this . config . usePersistedQueueStorage ) {
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export class NodeExceptionlessClient extends ExceptionlessClient {
2020 public async startup ( configurationOrApiKey ?: ( config : Configuration ) => void | string ) : Promise < void > {
2121 const config = this . config ;
2222
23- if ( configurationOrApiKey ) {
23+ if ( configurationOrApiKey && ! this . _initialized ) {
2424 if ( ! globalThis ?. localStorage ) {
2525 const storage = new LocalStorage ( undefined , new LocalStoragePolyfill ( process . cwd ( ) + '/.exceptionless' ) ) ;
2626 config . useLocalStorage = ( ) => storage ;
@@ -43,7 +43,7 @@ export class NodeExceptionlessClient extends ExceptionlessClient {
4343
4444 await super . startup ( configurationOrApiKey ) ;
4545
46- if ( configurationOrApiKey ) {
46+ if ( configurationOrApiKey && ! this . _initialized ) {
4747 config . removePlugin ( new SimpleErrorPlugin ( ) ) ;
4848 }
4949 }
You can’t perform that action at this time.
0 commit comments