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: support evict the flag cache #171

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

feat: support evict the flag cache #171

wants to merge 4 commits into from

Conversation

nicklasl
Copy link
Member

@nicklasl nicklasl commented Jul 5, 2024

This PR adds hacky support for manually evicting the Flag Cache if necessary.

@@ -147,6 +148,12 @@ export class Confidence implements EventSender, Trackable, FlagResolver {
}
}

clearFlagCache(): void {
if (this.config.flagResolverClient instanceof CachingFlagResolverClient) {
(this.config.flagResolverClient as CachingFlagResolverClient).forceEvict();
Copy link
Member Author

Choose a reason for hiding this comment

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

Not super elegant. We should consider this on the interface.

@@ -124,6 +126,8 @@ export type FlagEvaluation<T> = FlagEvaluation.Resolved<T> | FlagEvaluation.Stal

// @public
export interface FlagResolver extends Contextual<FlagResolver> {
// (undocumented)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add some docs 🙏

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