-
Notifications
You must be signed in to change notification settings - Fork 8
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
refactor validation of generic_resolver
rules to startup
#694
Conversation
- Move validation logic to `__attrs_post_init__` in GenericResolverRule. - Remove redundant error handling in GenericResolver processor. - Update corresponding tests to reflect changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good and works as expected :)
Getters need to be updated on the fly in the generic resolver. They are going to be refreshed periodically to get updated data from the HTTP getter. |
but isn't it already working with the general config refresh we have in Logprep? That way the configuration is also reloaded periodically and in case an exception is thrown, Logprep will continue running with the previous configuration. |
Oh, you are right, it does that. Last time I checked I've gotten an error when I raised a configuration error. I must have made a mistake then. However, as far as I know, a config refresh can't detect changes in HTTP getters, so it won't reload. |
We should avoid implementing special mechanics in favor of get a solution for the config refresh. I think it is better to solve the problem in the config refresh that configs behind getters gets evaluated too on config refresh. yes I see, that the fix here could be very easy. but if we have a lot of these easy fixes again it will be hard to implement global mechanics again. |
as discussed offline we can merge this pull request and then find a solution for loading external resources (that are not rule configurations) later. |
__attrs_post_init__
in GenericResolverRule.