-
Notifications
You must be signed in to change notification settings - Fork 326
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
Define sync channels without creating and closing them #19
Conversation
When a sync direction was disabled, the closing of a channel that wasn't used again was causing the entire program to exit as if there was an error. Switched these channels to be created with `var` instead, which stops this unexpected behavior.
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 you have so far is right, but I think we need to add a nil
channel check around line 200/201 otherwise a interrupt (Ctrl-C) will block forever.
Good catch! I've added nil checks within all of the different cases in that select statement. |
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.
Looks good.
In general we usually unit test our commands. Its my fault that these aren't unit tested (i.e. Consul CLI is all unit tested). I'll try to add some unit tests so I can lay the groundwork since it was my mess to start with. 😄I would merge this as-is though, just noting!
hey @adilyse, thanks for this. do you have any estimation of when a new docker image will be released? |
@jondeandres This is fix is now available in v0.2.1, just released! |
hey @adilyse,thank you very much, I will try it today. Thanks for the quick fix! |
Fixes #7.
When a sync direction was disabled, the closing of a channel that
wasn't used again was causing the entire program to exit as if there
was an error.
Switched these channels to be created with
var
instead, whichstops this unexpected behavior.