Add option to disable synchronization on creation for auto refresh cache #5940
+518
−384
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why are the changes needed?
We have an interesting usage pattern of the auto refresh cache.
When items are synchronized in single item batches upon creation it disrupts our batch synchronization strategy and puts a lot of load on the server where task state is being read from. You could tune the rate limiter but it will also affect both single item batch and regular batch synchronization. So the solution we found was to add this option which just doesn't try to add a single item batch when items are created in the cache.
What changes were proposed in this pull request?
Adds an option to the auto refresh cache
SyncOnCreate
which defaults to true for backwards compatibility.How was this patch tested?
We run this in production but I also added unit tests.
Check all the applicable boxes
Related PRs
Built on top of #5813