Merge bridge / delivery / rest-server into one process#63
Merge bridge / delivery / rest-server into one process#63bladehan1 merged 2 commits intobttcprotocol:developfrom ClarkChenc:merge_delivery_services
Conversation
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## develop #63 +/- ##
========================================
Coverage 60.29% 60.29%
========================================
Files 52 52
Lines 4423 4423
========================================
Hits 2667 2667
Misses 1519 1519
Partials 237 237 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more 📢 Have feedback on the report? Share it here. |
| // exit | ||
| os.Exit(1) | ||
| for _, service := range services { | ||
| srv := service |
There was a problem hiding this comment.
Is there any reason to allocate a new variable here?
There was a problem hiding this comment.
No need to allocate new variable here. But for some cases, we need to cache objects' addresses in for-range scope, and service will always point to a same address, so we need to allocate a new variable. So such idiom can prevent mistakes in the future.
|
|
||
| // bridge flags = start flags (all, only) + root bridge cmd flags. | ||
| cmd.Flags().Bool("all", false, "start all bridge services") | ||
| cmd.Flags().StringSlice("only", []string{}, "comma separated bridge services to start") |
There was a problem hiding this comment.
are "all" and "only" used in some functions?
There was a problem hiding this comment.
bridge has two service, listener and processor, "all" means to start all services, while "only" can start target service. In general, we use "all" when start bridge. Here is just to decorate main cmd just as bridge cmd.
| tracerWritePerm = 0666 | ||
| pvKeyFilePerm = 0777 | ||
| pvStateFilePerm = 0777 | ||
| nodeDirPerm = 0o755 |
There was a problem hiding this comment.
Why do you need o permissions?
This pr is aimed to start bridge / rest-server along with deliveryd process.