diff --git a/packages/node/src/local/fetcher.ts b/packages/node/src/local/fetcher.ts index 88f4273..897b6f8 100644 --- a/packages/node/src/local/fetcher.ts +++ b/packages/node/src/local/fetcher.ts @@ -37,7 +37,9 @@ export class FlagConfigFetcher { const endpoint = `${this.serverUrl}/sdk/rules?eval_mode=local`; const headers = { Authorization: `Api-Key ${this.apiKey}`, + Accept: 'application/json', 'X-Amp-Exp-Library': `experiment-node-server/${PACKAGE_VERSION}`, + 'Content-Type': 'application/json;charset=utf-8', }; const body = null; this.logger.debug('[Experiment] Get flag configs'); diff --git a/packages/node/src/local/poller.ts b/packages/node/src/local/poller.ts index 1aa95bf..80b066d 100644 --- a/packages/node/src/local/poller.ts +++ b/packages/node/src/local/poller.ts @@ -49,7 +49,11 @@ export class FlagConfigPoller { if (!this.poller) { this.logger.debug('[Experiment] poller - start'); this.poller = setInterval(async () => { - await this.update(onChange); + try { + await this.update(onChange); + } catch (e) { + this.logger.debug('[Experiment] flag config update failed', e); + } }, this.pollingIntervalMillis); // Fetch initial flag configs and await the result.