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

ASN DB settings get fixed on their initial values #1377

Open
mattias-p opened this issue Jul 22, 2024 · 0 comments
Open

ASN DB settings get fixed on their initial values #1377

mattias-p opened this issue Jul 22, 2024 · 0 comments

Comments

@mattias-p
Copy link
Member

The Zonemaster::Engine::ASNLookup module has two global variables @db_sources and $db_style. These get computed once based on profile properties, but they are never reset. These global values should either be reset between test runs, or they shouldn't be global variables at all.

While these variables are publicly accessible to and could technically be reset from calling code, this requirement is not documented, it's not implemented in Backend, and it's rather bad API design. It would be better to add a class method called reset or something to the Zonemaster::Engine::ASNLookup module. This reset method should probably be called automatically from Zonemaster::Engine->reset() or perhaps Zonemaster::Engine::Test->{run_for_all,run_module,run_one}().

But really, from a quick look at the code I believe we should be able to recompute these values anew every time we need them and do away with the caching altogether.

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

1 participant