-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prevent calling ReportError with the same error in a row
The resolver already prevents that UpdateState is called for the same address multiples times in a row, do the same when reporting errors. Only call ReportError() if the same error hasn't been reported in the last call and UpdateState hasn't been called last. This prevents that we unnecessary report the same state multiple times and trigger the same events for the connection. The code is refactored to store the last reported state in the consulResolver struct and reporting addresses and errors is moved to separate methods.
- Loading branch information
Showing
1 changed file
with
59 additions
and
36 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