PostHog / posthog-node

Official PostHog Node library
MIT License
21 stars 19 forks source link

fix: feature flag pollingInterval wrong init #47

Closed xahhy closed 3 years ago

xahhy commented 3 years ago

Changes

Fix wrong feature flags poller init of the pollingInterval. Which will cause serious unlimited API calling with no interval time

We use the featureFlagsPollingInterval variable when init it. but used the wrong pollingInterval when actually init it.

this.featureFlagsPoller = new FeatureFlagsPoller({
                featureFlagsPollingInterval:
                    typeof options.featureFlagsPollingInterval === 'number'
                        ? options.featureFlagsPollingInterval
                        : FIVE_MINUTES,
                personalApiKey: options.personalApiKey,
                projectApiKey: apiKey,
                timeout: options.timeout || false,
                host: this.host,
                featureFlagCalledCallback,
            })

...

Checklist