Skip to content

Add support for failover cache #23

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

Merged
merged 1 commit into from
Feb 25, 2021

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
Collaborator

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 laravel-unleash:master Feb 25, 2021
@mxkxf
Copy link
Collaborator

mxkxf commented Feb 25, 2021

Thanks @dshafik ❤️

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

Successfully merging this pull request may close these issues.

2 participants