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

low priority feature req - automatically remove stale flags #173

Closed
kacorvus opened this issue Apr 26, 2024 · 1 comment
Closed

low priority feature req - automatically remove stale flags #173

kacorvus opened this issue Apr 26, 2024 · 1 comment

Comments

@kacorvus
Copy link

keep track of uses of a given flag using simple metric system + automatically delete/remove flags that haven't been referenced after a stale interval

@tompave
Copy link
Owner

tompave commented Aug 6, 2024

I see how this could be useful, but I don't think that it should be added to FWF as a feature. This is because of a few reasons:

  1. FWF aims to be simple, and do one thing well.
  2. Adding a usage-tracking system and increment some counter (writing data somewhere) every time a flag is queried is going to have a performance overhead. This needs to be understood before adding something of this sort. I wonder if this could be done in-memory, without counter persistence (therefore, with less overhead), but then the usage tracking would become unreliable.
  3. This is something that can be easily added in application code with a wrapper for FWF, and even released as an extension on Hex. For example, your application could use a facade module that wraps FWF and its enabled? function, increments the counter with each call, and then runs some sweeper GenServer that periodically deletes stale flags.

@kacorvus kacorvus closed this as completed Aug 6, 2024
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

No branches or pull requests

2 participants