-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow milestone snapshot saving logic to be overridden in the middleware
This change adds a flag to `SubmitRequest`: `saveMilestoneSnapshot`. This flag defaults to `null`. If this value is left as `null`, then milestone snapshots will be written according to the interval set in the options passed into the provided `MilestoneDB` instance. The value can be overridden in middleware, like in the test case in this commit. If the value of `request.saveMilestoneSnapshot` is changed to a `boolean`, then all interval logic is ignored, and the value of that flag is used directly to determine if a milestone should be saved. This allows more complex milestone logic, such as: - saving a milestone once per day - different intervals depending on collection - non-uniform milestone intervals
- Loading branch information
Alec Gibson
committed
Aug 16, 2018
1 parent
f828ed9
commit 55ed07a
Showing
2 changed files
with
71 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters