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

Feature: Add support for optional timeout. #6

Merged
merged 6 commits into from
Jan 10, 2018
Merged

Conversation

nspragg
Copy link
Contributor

@nspragg nspragg commented Jan 10, 2018

Relates to:
https://jira.dev.bbc.co.uk/browse/IPLAYER-31846

Implementation notes:

  • We currently don't have a timeout, so I've made this optional to retain existing behaviour i.e no default.
  • Only timeouts on .get has been implemented. Writes are out of scope for this PR.
  • Works in conjunction with ignoreCacheErrors so we can bypass cache if a lookup is taking too long

@nspragg nspragg requested a review from niklasR January 10, 2018 13:38
@nspragg nspragg self-assigned this Jan 10, 2018
Copy link
Contributor

@niklasR niklasR left a comment

Choose a reason for hiding this comment

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

Should we add a stats for cache.timeouts for when it happens so we can add it to the errors/hits/misses graph?

});
});

it('ignores cache timeout error and requests from the system of record.', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

What is meant by from the system of record?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's an official caching term for source system e.g our episodes API

@nspragg
Copy link
Contributor Author

nspragg commented Jan 10, 2018

cache.timeouts - good idea. Do you want that as part of this PR or can I add it later?

@niklasR
Copy link
Contributor

niklasR commented Jan 10, 2018

Same PR please.

Copy link
Contributor

@niklasR niklasR left a comment

Choose a reason for hiding this comment

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

👍

@nspragg
Copy link
Contributor Author

nspragg commented Jan 10, 2018

cheers

@nspragg nspragg merged commit af9f042 into master Jan 10, 2018
@nspragg nspragg deleted the cacheLookupTimeout branch January 10, 2018 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants