frontend: use LISTEN_ADDR, refactor Listen code
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
This commit is contained in:
parent
7b35fb1291
commit
ab2b15723c
2 changed files with 13 additions and 3 deletions
|
@ -42,6 +42,8 @@ spec:
|
||||||
value: "shippingservice:50051"
|
value: "shippingservice:50051"
|
||||||
- name: CHECKOUT_SERVICE_ADDR
|
- name: CHECKOUT_SERVICE_ADDR
|
||||||
value: "checkoutservice:5050"
|
value: "checkoutservice:5050"
|
||||||
|
- name: LISTEN_ADDR
|
||||||
|
value: "0.0.0.0"
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
|
|
|
@ -107,9 +107,17 @@ func main() {
|
||||||
Handler: handler,
|
Handler: handler,
|
||||||
Propagation: &b3.HTTPFormat{}}
|
Propagation: &b3.HTTPFormat{}}
|
||||||
|
|
||||||
log.Infof("starting server on " + addr + ":" + srvPort)
|
go func() {
|
||||||
go log.Fatal(http.ListenAndServe(addr+":"+secondaryPort, handler))
|
log.Infof("starting server on " + addr + ":" + srvPort)
|
||||||
log.Fatal(http.ListenAndServe(addr+":"+srvPort, handler))
|
log.Fatal(http.ListenAndServe(addr+":"+srvPort, handler))
|
||||||
|
}()
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
log.Infof("starting healthcheck server on " + addr + ":" + secondaryPort)
|
||||||
|
log.Fatal(http.ListenAndServe(addr+":"+secondaryPort, handler))
|
||||||
|
}()
|
||||||
|
|
||||||
|
select {}
|
||||||
}
|
}
|
||||||
|
|
||||||
func initTracing(log logrus.FieldLogger) {
|
func initTracing(log logrus.FieldLogger) {
|
||||||
|
|
Loading…
Reference in a new issue