Fix #102
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"github.com/BBVA/kapow/internal/server/control"
|
||||
"github.com/BBVA/kapow/internal/server/data"
|
||||
"github.com/BBVA/kapow/internal/server/user"
|
||||
@@ -35,10 +37,12 @@ type ServerConfig struct {
|
||||
|
||||
// StartServer Starts one instance of each server in a goroutine and remains listening on a channel for trace events generated by them
|
||||
func StartServer(config ServerConfig) {
|
||||
go control.Run(config.ControlBindAddr)
|
||||
go data.Run(config.DataBindAddr)
|
||||
go user.Run(config.UserBindAddr, config.CertFile, config.KeyFile, config.ClientCaFile, config.ClientAuth)
|
||||
var wg = sync.WaitGroup{}
|
||||
wg.Add(3)
|
||||
go control.Run(config.ControlBindAddr, &wg)
|
||||
go data.Run(config.DataBindAddr, &wg)
|
||||
go user.Run(config.UserBindAddr, &wg, config.CertFile, config.KeyFile, config.ClientCaFile, config.ClientAuth)
|
||||
|
||||
// Wait for ever
|
||||
select {}
|
||||
// Wait for servers signals in order to return
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user