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

use cmd context in cache init functions #1014

Open
iwpnd opened this issue Dec 3, 2024 · 0 comments
Open

use cmd context in cache init functions #1014

iwpnd opened this issue Dec 3, 2024 · 0 comments

Comments

@iwpnd
Copy link
Member

iwpnd commented Dec 3, 2024

I just walked through the code and the cache init routine is a bit confusing. The part I'm referencing enhancing with the context is the InitFunc:

type InitFunc func(dict.Dicter) (Interface, error)

This is called by the For method:

func For(cacheType string, config dict.Dicter) (Interface, error) {

Which is invoked by the internal cmd/internal/register/ package:

func Cache(config dict.Dicter) (cache.Interface, error) {

The main value we would get with this plumbing is if tegola is started up and then killed before the cache initializes fully.

I'm not going to block the PR on this request, but just following up on the intent of my comment. Your call if you want to make this change ;-)

Originally posted by @ARolek in #1013 (comment)

@ARolek ARolek moved this to Ready in Tegola Roadmap Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready
Development

No branches or pull requests

1 participant