-
Notifications
You must be signed in to change notification settings - Fork 674
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
NOISSUE - Prevent infinite loop in lora-adapter if Redis init fail #647
Conversation
Codecov Report
@@ Coverage Diff @@
## master #647 +/- ##
==========================================
- Coverage 87.36% 86.73% -0.64%
==========================================
Files 62 62
Lines 3942 3625 -317
==========================================
- Hits 3444 3144 -300
+ Misses 340 327 -13
+ Partials 158 154 -4
Continue to review full report at Codecov.
|
func (es eventStore) Subscribe(subject string) error { | ||
if err := es.client.XGroupCreateMkStream(stream, group, "$").Err(); err != nil && err.Error() != exists { | ||
return err | ||
} |
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.
You shouldn't return here. If consumer group already exists, just continue.
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.
@dusanb94 what we do here? I thought that this is the fix
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.
You return only if there is an error other than BUSYGROUP Consumer Group name already exists
. If there is no error or error is exactly this one, you will proceed with your subscription.
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.
Right, this is correct @anovakovic01
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.
Didn't see that part. IMHO, this line is too long. Can you break it into multiple lines? Also, is there predefined error for this in redis lib?
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.
I could not find any meaningful error. Line length fixed.
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.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!
…bsmach#647) * NOISSUE - Prevent infinite loop in lora-adapter if Redis init fail Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix line length Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: Manuel Imperiale manuel.imperiale@gmail.com