Skip to content

Commit 930451a

Browse files
remove internal status management
Signed-off-by: Thomas Poignant <[email protected]>
1 parent 3ad0e91 commit 930451a

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

libs/providers/go-feature-flag-web/src/lib/go-feature-flag-web-provider.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
OpenFeatureEventEmitter,
99
Provider,
1010
ProviderEvents,
11-
ProviderStatus,
1211
ResolutionDetails,
1312
StandardResolutionReasons,
1413
TypeMismatchError,
@@ -66,28 +65,19 @@ export class GoFeatureFlagWebProvider implements Provider {
6665
this._dataCollectorHook = new GoFeatureFlagDataCollectorHook(options, logger);
6766
}
6867

69-
// status of the provider
70-
private _status: ProviderStatus = ProviderStatus.NOT_READY;
71-
72-
get status(): ProviderStatus {
73-
return this._status;
74-
}
75-
7668
async initialize(context: EvaluationContext): Promise<void> {
7769
if (!this._disableDataCollection && this._dataCollectorHook) {
7870
this.hooks = [this._dataCollectorHook];
7971
this._dataCollectorHook.init();
8072
}
8173
return Promise.all([this.fetchAll(context), this.connectWebsocket()])
8274
.then(() => {
83-
this._status = ProviderStatus.READY;
8475
this._logger?.debug(`${GoFeatureFlagWebProvider.name}: go-feature-flag provider initialized`);
8576
})
8677
.catch((error) => {
8778
this._logger?.error(
8879
`${GoFeatureFlagWebProvider.name}: initialization failed, provider is on error, we will try to reconnect: ${error}`,
8980
);
90-
this._status = ProviderStatus.ERROR;
9181
this.handleFetchErrors(error);
9282

9383
// The initialization of the provider is in a failing state, we unblock the initialize method,
@@ -254,10 +244,8 @@ export class GoFeatureFlagWebProvider implements Provider {
254244
attempt++;
255245
try {
256246
await this.fetchAll(ctx, flagsChanged);
257-
this._status = ProviderStatus.READY;
258247
return;
259248
} catch (err) {
260-
this._status = ProviderStatus.ERROR;
261249
this.handleFetchErrors(err);
262250
await new Promise((resolve) => setTimeout(resolve, delay));
263251
delay *= this._retryDelayMultiplier;

0 commit comments

Comments
 (0)