Skip to content

Commit 4502c48

Browse files
committed
remove oneshot initializer if in polling only mode
1 parent bc64d59 commit 4502c48

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

packages/shared/sdk-server/src/LDClientImpl.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -319,14 +319,16 @@ function constructFDv2(
319319
// make the FDv2 composite datasource with initializers/synchronizers
320320
const initializers: subsystem.LDDataSourceFactory[] = [];
321321

322-
// use one shot initializer for performance and cost
323-
initializers.push(
324-
() =>
325-
new OneShotInitializerFDv2(
326-
new Requestor(config, platform.requests, baseHeaders, '/sdk/poll', config.logger),
327-
config.logger,
328-
),
329-
);
322+
// use one shot initializer for performance and cost if we can do a combination of polling and streaming
323+
if (isStandardOptions(dataSystem.dataSource)) {
324+
initializers.push(
325+
() =>
326+
new OneShotInitializerFDv2(
327+
new Requestor(config, platform.requests, baseHeaders, '/sdk/poll', config.logger),
328+
config.logger,
329+
),
330+
);
331+
}
330332

331333
const synchronizers: subsystem.LDDataSourceFactory[] = [];
332334
// if streaming is configured, add streaming synchronizer

0 commit comments

Comments
 (0)