Conversation
|
Before change: Afterwards: |
There was a problem hiding this comment.
Pull request overview
This PR fixes spurious Deinit log noise that occurs when --check-config or --dry-run (on failure) execute cleanup without having initialized modules. A boolean flag is introduced to track whether module initialization was attempted, ensuring Deinit() is only called when appropriate.
Changes:
- Added
modulesInitialedfield to track whetherinitModules()was called - Modified
cleanup()to only callDeinit()if modules were initialized - Simplified cleanup logic by removing the nil check for devices
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
12f209a to
285046c
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
--check-config and --dry-run (on failure) call cleanup() without having called initModules(), causing spurious Deinit log noise on every config validation. Track whether module init was attempted and only run Deinit if it was. Signed-off-by: Fabian Wienand <fabian.wienand@9elements.com>
|
Wouldn't it be even more robust to save the "init happened" info with each module? |
|
Sure this could also be done. I don't favor any of the approaches. I can rewrite it that way too. |
--check-config and --dry-run (on failure) call cleanup() without having called initModules(), causing spurious Deinit log noise on every config validation. Track whether module init was attempted and only run Deinit if it was.