forked from lf-edge/eve
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use 'defer' to simplify handling of AppNetworkStatus pending flags
Currently, we have to remember to set PendingAdd/PendingModify inside AppNetworkStatus to false just before the corresponding handler returns. However, there are few error branches where we forgot to clear the pending flag. This causes zedmanager to just wait and not report the error published inside the AppNetworkStatus. Instead of fixing this case-by-case, let's take advantage of 'defer' to make sure that we will never forget to clear the Pending flag, even if a new branch with return statement is added in the future. Signed-off-by: Milan Lenco <milan@zededa.com> (cherry picked from commit fbacc17)
- Loading branch information
1 parent
be13bbc
commit 2476df9
Showing
2 changed files
with
12 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters