-
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
MF-898 - Add bulk connections endpoint #948
Conversation
Signed-off-by: nwneisen <nwneisen@gmail.com>
Signed-off-by: nwneisen <nwneisen@gmail.com>
@manuio I started switching this code over for multiple channels and I realized that I can only have one variadic parameter. I don't see another way besides making the channelIDs parameter a slice but I thought I'd see if you had any ideas before changing everything over. |
@nwneisen I'm not sure either... In any case the service endpoint can accept two slices of strings. But for the service method I'm not sure... Maybe a for loop here |
@manuio I was thinking a for loop would be the way to go without getting caught up in too much optimization. The downside is a for loop on the service method would create multiple transactions; one for each channel. This behavior might not be terrible but I think if one transaction fails then it should be recorded to be returned to the user and the rest allowed to continue. |
@nwneisen @manuio IMHO it's OK to have 2 slices, yes can have only 1 variadic param. Also what if I want to reverse, to connect 100 things to 1 channel? Not 1 thing to 100 channels. Any ideas @mainflux/maintainers ? |
I vote for a single transaction and two slices. |
Signed-off-by: Nick Neisen <nwneisen@gmail.com>
Signed-off-by: Nick Neisen <nwneisen@gmail.com>
Signed-off-by: Nick Neisen <nwneisen@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #948 +/- ##
==========================================
+ Coverage 83.63% 83.71% +0.08%
==========================================
Files 75 75
Lines 5248 5288 +40
==========================================
+ Hits 4389 4427 +38
- Misses 590 592 +2
Partials 269 269
Continue to review full report at Codecov.
|
Signed-off-by: Nick Neisen <nwneisen@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
Signed-off-by: Nick Neisen <nwneisen@gmail.com>
Signed-off-by: Nick Neisen <nwneisen@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
Signed-off-by: nwneisen <nwneisen@gmail.com>
Signed-off-by: nwneisen <nwneisen@gmail.com>
LGTM! Good job @nwneisen |
* Change connect endpoint to use bulk connections Signed-off-by: nwneisen <nwneisen@gmail.com> * Add documentation for bulk connect Signed-off-by: nwneisen <nwneisen@gmail.com> * Update service and postgres for multiple channels Signed-off-by: Nick Neisen <nwneisen@gmail.com> * Update bulk connect endpoint Signed-off-by: Nick Neisen <nwneisen@gmail.com> * Fix missed test Signed-off-by: Nick Neisen <nwneisen@gmail.com> * Improve test code coverage Signed-off-by: Nick Neisen <nwneisen@gmail.com> * Change methods to use shared data type Signed-off-by: Nick Neisen <nwneisen@gmail.com> * Fix provisioning example Signed-off-by: Nick Neisen <nwneisen@gmail.com> * Change depreciation messages to specify v1.0.0 Signed-off-by: nwneisen <nwneisen@gmail.com> * Switch singluar log to plural Signed-off-by: nwneisen <nwneisen@gmail.com>
Signed-off-by: nwneisen nwneisen@gmail.com
What does this do?
Adds an endpoint to create bulk connections.
Which issue(s) does this PR fix/relate to?
Relates to #898.
List any changes that modify/break current functionality
None
Have you included tests for your changes?
Yes
Did you document any new/modified functionality?
Yes
Notes