Skip to content

[Synchroniser] - Implement batch size config and retries strategy for Impressions#22

Merged
emilianofant-split merged 3 commits intomainfrom
efant_implementRetryImpressions
Jul 21, 2021
Merged

[Synchroniser] - Implement batch size config and retries strategy for Impressions#22
emilianofant-split merged 3 commits intomainfrom
efant_implementRetryImpressions

Conversation

@emilianofant-split
Copy link
Contributor

@emilianofant-split emilianofant-split commented Jul 20, 2021

Javascript Slim Synchronizer

What did you accomplish?

In this PR, I'm adding the
a. Retries attempt per request and
b. Impression's Batch size configuration

  • The config to determine the batch size of elements to POP from Storage (Events)
  • Wrap the pop function into a function that can call itself recursively until there are no more elements in the Storage.
  • Added CLI config and manager capability to create an Impressions Synchroniser with a custom batch size value.

... to the Impression Synchronizer. (Similar to #19 and #20)

ALSO, I've made some refactor to the retry function to be part of a utils file, where some helpers function may be placed.

How do we test the changes introduced in this PR?

1 - Checkout this branch:
git checkout efant_implementRetryImpressions
2 - Run unit tests
npm run test:unit

If you want to test it manually:
This file is a Custom Storage to connect with Redis, and can be used for manual tests.
For example:

npm run build && clear && ./dist/cli.js -k <A_VALID_APIKEY> -s ../path/to/inRedisStorage.cjs -r https://sdk.split-stage.io/api -e https://events.split-stage.io/api -p storagePrefix -impressionsPerPost 100 -maxRetries 4

Note the path to the Storage file

Related JIRA tickets and PRs

[Synchroniser] - Implement batch size config and retries strategy to Impressions

Extra Notes

Copy link
Contributor

@EmilianoSanchez EmilianoSanchez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@emilianofant-split emilianofant-split merged commit fa2d00b into main Jul 21, 2021
@emilianofant-split emilianofant-split deleted the efant_implementRetryImpressions branch July 21, 2021 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants