-
Notifications
You must be signed in to change notification settings - Fork 125
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
Refactored usage of service clients to be compatible with latest contracts changes. #447
Conversation
@Nitu-coder try this changeset. I believe it will address your issue. |
Codecov Report
@@ Coverage Diff @@
## master #447 +/- ##
==========================================
- Coverage 56.21% 55.77% -0.45%
==========================================
Files 24 24
Lines 2396 2415 +19
==========================================
Hits 1347 1347
- Misses 951 970 +19
Partials 98 98
Continue to review full report at Codecov.
|
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.
one question, otherwise look good.
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.
Thanks for the effort on this PR. Please see whether my review comments are reasonable.
@cloudxxx8 Rebased and updated, please take a look. |
@lenny-intel basically yes, but if you wanted to see my diff, that is at 5e5fdef |
Now that #432 is merged, this PR is ready for review. @lenny-intel @cloudxxx8 |
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.
Just one very minor comment to fix.
…t contracts changes. Signed-off-by: Brandon Forster <me@brandonforster.com>
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.
LGTM
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.
LGTM overall, need some clarifications on the behavior with -r
argument
defer e.wg.Done() | ||
|
||
// run fetchURL once before looping so we get the first check before the first timer interval | ||
e.fetchURL(ch) |
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.
Maybe it's better to call e.wg.Done()
after first check ?
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.
Using defer instead of calling it explicitly allows it to run even when an error occurs. If we called it under the ctx.Done() case, it would only finish on the happy path. This way, it finishes whenever the routine ends, whether that's because it was successful or because it failed.
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.
my suggestion is a followup of the above discussion: if we keep waitGroup.wait()
we should call wg.Done()
immediately after first check so that the main thread won't be blocked and then we can still monitor the URL change in the background
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.
What should we do in the error case? Never call wg.Done()
?
Signed-off-by: Brandon Forster <me@brandonforster.com>
Signed-off-by: Brandon Forster <me@brandonforster.com>
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.
LGTM
Fixes #446
Fixes #445
Signed-off-by: Brandon Forster me@brandonforster.com