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

Make cache timeout values configurable #410

Closed
leon-richardt opened this issue Jan 11, 2023 · 2 comments · Fixed by #419
Closed

Make cache timeout values configurable #410

leon-richardt opened this issue Jan 11, 2023 · 2 comments · Fixed by #419

Comments

@leon-richardt
Copy link
Contributor

Idea spawned from #409 (comment)

@M4tthewDE
Copy link
Contributor

M4tthewDE commented Jan 23, 2023

I took a look at how to implement this the best way. Since there are a good amount of different caches (>10), individual config entries for each timeout value would bloat the config quiet a bit.

A possible solution is to use a map:

cache-timeouts:
   youtube: 24h
   twitter: 10m

This is nice in the config.yml in my opinion, but as far as I can see viper does not support maps in command-line flags.
The cache value could as a result only be set via the config.yml.

Not sure which of the two would be the best option, suggestions appreciated!

@pajlada
Copy link
Member

pajlada commented Jan 23, 2023

We already don't use maps where we could, so I think it makes sense to just add long keys here too
atm we have youtube-api-key, we'd want to add something like youtube-video-cache-duration and youtube-profile-cache-duration, for twitter we'd add twitter-profile-cache-duration and twitter-tweet-cache-duration.

I'm flexible with the naming

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

Successfully merging a pull request may close this issue.

3 participants