Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(persister): Add keepUnusedRequests config option #108

Merged
merged 6 commits into from
Sep 14, 2018

Conversation

offirgolan
Copy link
Collaborator

@offirgolan offirgolan commented Sep 13, 2018

Currently by default, all new requests are appended to the currently existing recording HAR file. Although this works well (especially when using Polly for an offline only tool), it creates bloated recording files with unused requests. This PR handles the more generic case where a recording file should only contain the requests that have been captured by the running Polly instance.

Changes Proposed

keepUnusedRequests new

Type: Boolean
Default: false

When disabled, requests that have not been captured by the running Polly instance will be removed. This ensures that a recording will only contain the requests that were made during the lifespan of the Polly instance. When enabled, new requests will be appended to the recording file.

Example

polly.configure({
 persisterOptions: {
   keepUnusedRequests: true
 }
});

@offirgolan offirgolan changed the title feat(persister): Persister cleanup recordings feat(persister): Add keepUnusedRequests config option Sep 13, 2018
@offirgolan offirgolan added enhancement ✨ New feature or request 📦 persister labels Sep 13, 2018
_Default_: `false`

When disabled, requests that have not been captured by the running Polly
instance will be removed. This ensures that a recording will only contain the
Copy link
Contributor

Choose a reason for hiding this comment

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

"will be removed from any previous recording."

@offirgolan offirgolan merged commit 3f5f5b2 into master Sep 14, 2018
@offirgolan offirgolan deleted the persister-cleanup-recordings branch September 14, 2018 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request 📦 persister
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants