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(data-point-service): run outputType before adding entry #452

Merged

Conversation

acatl
Copy link
Collaborator

@acatl acatl commented Apr 15, 2020

What:

fixes #451

if outputType reducer is set, it must pass in order for the entry to be added to the cache store.

Why:

See #451

How:

By running executing outputType reducer before adding the entry into the cache store.

Checklist:

  • Has Breaking changes N/A
  • Documentation
  • Tests
  • Ready to be merged
  • Added username to all-contributors list N/A

output type if set, it must pass in order for the entry to be added to cache store

fix ViacomInc#451
@@ -19,74 +19,72 @@ $ npm install data-point-cache

Create a new DataPoint Service Object


Copy link
Collaborator Author

Choose a reason for hiding this comment

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

truly sorry for all of these changes, it seems the file had not been ran via prettier before. my only change on this file is marked at the bottom of the file


In the case the revalidation fails the flag will be removed to allow a new revalidation to be triggered.

It is important to know that once the `staleWhileRevalidate` delta has also expired a background revalidation will no longer be triggered and cold lookup will be triggered instead. For this reason it is important to carefully set the cache settings to have a solid caching strategy.

### Validation
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is the only part I added regarding this PR

@codecov
Copy link

codecov bot commented Apr 15, 2020

Codecov Report

Merging #452 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #452   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          139       139           
  Lines         1972      1978    +6     
  Branches       195       197    +2     
=========================================
+ Hits          1972      1978    +6     
Impacted Files Coverage Δ
...ackages/data-point-service/lib/cache-middleware.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f017e44...b03d0fe. Read the comment docs.

@acatl acatl self-assigned this Apr 15, 2020
@acatl acatl added the 📦data-point-service DataPointService Package label Apr 15, 2020
jerryluna
jerryluna previously approved these changes Apr 15, 2020
@acatl acatl requested a review from micheleriva April 16, 2020 14:05
micheleriva
micheleriva previously approved these changes Apr 16, 2020
arik223
arik223 previously approved these changes Apr 16, 2020

const HelloWorld = DataPoint.Model("HelloWorld", {
value: (input, acc) => {
// const id = parseInt(acc.locals.query.id, 10);
Copy link
Contributor

Choose a reason for hiding this comment

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

remove comment

raingerber
raingerber previously approved these changes Apr 17, 2020
@acatl acatl requested a review from raingerber April 18, 2020 20:40
@acatl acatl merged commit 97f54f0 into ViacomInc:master Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦data-point-service DataPointService Package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

check output type before storing cache entry
5 participants