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

FFM-9314 Refresh cache if FeatureConfigs are outdated #122

Merged
merged 1 commit into from
Sep 13, 2023
Merged

Conversation

jcox250
Copy link
Contributor

@jcox250 jcox250 commented Sep 12, 2023

What

  • Makes sure that we refresh the cache whenever we call SetFlags if we have outdated flags in the cache
  • Adds unit tests

@jcox250 jcox250 changed the title FFM-9314 Check all flags to see if a single one is outdated FFM-9314 Refresh cache if FeatureConfigs are outdated Sep 12, 2023
if ok && cacheable {
r.cache.Set(flagKey, flag)
}
return flag.([]rest.FeatureConfig), nil
Copy link
Contributor

Choose a reason for hiding this comment

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

should we move this return statement inside the ok block? So if we fail to get from storage, and weve already failked to get from the cache, we error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea I think that makes sense

Copy link
Contributor

@davejohnston davejohnston left a comment

Choose a reason for hiding this comment

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

It looks good. I had one comment around the placement of a return statement if you can take a look.

**What**

- Changes conditon so we only break out of SetFlags if the flags ARE NOT
  outdated

**Why**

- If the flags are outdated we want to carry on inside SetFlags and
  refresh the cache
@jcox250 jcox250 merged commit 25c087a into main Sep 13, 2023
3 checks passed
@erdirowlands erdirowlands deleted the FFM-9314 branch November 3, 2023 17:46
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.

None yet

2 participants