Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.

Add support for failover cache #23

Merged
merged 1 commit into from
Feb 25, 2021
Merged

Conversation

dshafik
Copy link
Contributor

@dshafik dshafik commented Feb 7, 2021

The failover cache will ensure that the last successful set of features fetched from Unleash are always returned if the unleash server is down.

  • Changes cache TTL default to 15s, the standard default
  • Add unleash.cache.failover option that will pull the last successful result from the cache
    • This setting is independent of regular caching
    • The cache is always stored, to allow enabling the feature during a failure incidence
  • This change also moves the requests for features out of the constructor
    • Possible to use in Facades
    • Still "cached" for the lifetime of the Unleash object

@dshafik
Copy link
Contributor Author

dshafik commented Feb 19, 2021

@mikefrancis anything you need from me to move this forward?

@mxkxf
Copy link
Owner

mxkxf commented Feb 19, 2021

Sorry @dshafik - I think this needs rebasing or updating first.

Once that's done I'll take a look at this over the weekend :)

@dshafik
Copy link
Contributor Author

dshafik commented Feb 19, 2021

@mikefrancis ah, because you merged #24 first, I'll make the changes ASAP

@dshafik dshafik force-pushed the add-failover-caching branch from 59dc165 to 270eb9f Compare February 19, 2021 19:30
@dshafik dshafik force-pushed the add-failover-caching branch from 270eb9f to ff329d6 Compare February 24, 2021 21:29
- Changes cache TTL default to 15s, the standard default
- Add unleash.cache.failover option that will pull the last successful result from the cache
  - This setting is independent of regular caching
  - The cache is always stored, to allow enabling the feature during a failure incidence
- This change also moves the requests for features out of the constructor
  - Possible to use in Facades
  - Still "cached" for the lifetime of the Unleash object
@dshafik dshafik force-pushed the add-failover-caching branch from ff329d6 to 853af1f Compare February 24, 2021 21:37
@mxkxf mxkxf merged commit c579789 into mxkxf:master Feb 25, 2021
@mxkxf
Copy link
Owner

mxkxf commented Feb 25, 2021

Thanks @dshafik ❤️

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants