-
Notifications
You must be signed in to change notification settings - Fork 0
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
CoinbasePro: Add subscription templating #3
CoinbasePro: Add subscription templating #3
Conversation
0704970
to
9205394
Compare
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.
Nits and questions.
} | ||
time.Sleep(time.Millisecond * 10) | ||
errs = common.AppendError(errs, err) | ||
} | ||
return nil |
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.
Shouldn't errs be returned around here?
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.
No, We want to collect all of the errors, not just return on the very first one 😄
In reality, in situations where engine is running, we expect subs to be len(1).
However the for loop protects against a manual call to Subscribe before calling ExpandTemplates.
Also just cleaner than having to len protect subs and then use s := subs[0]
.
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 mean at the end of the function, on line 375, we should return errs instead of nil. If we haven't collected any errors, errs will just be nil anyway, and at the end it won't interrupt execution.
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.
😳
Sorry, you're completely right and I missed your point entirely
Erm. Yeah. Shocking I even brought this up to look at it 🤦
Fixed 62c48af
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.
Further discussion
} | ||
time.Sleep(time.Millisecond * 10) | ||
errs = common.AppendError(errs, err) | ||
} | ||
return nil |
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 mean at the end of the function, on line 375, we should return errs instead of nil. If we haven't collected any errors, errs will just be nil anyway, and at the end it won't interrupt execution.
Hello @cranktakular 👋
This PR is for merging into your existing coinbase api revamp branch.
ticker_batch
subuser
subAny questions, just ask, here or on slack 🙂