Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions cmd/gnetcli_server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,14 @@ func main() {
logger = zap.Must(logConfig.Build())

if len(cfg.UnixSocket) > 0 {
// log level and "init unix socket", "path" is used in gnetcli_adapter
logger.Warn("init unix socket", zap.String("path", cfg.UnixSocket))
unixSocketLn, err := newUnixSocket(cfg.UnixSocket)
if err != nil {
logger.Panic("unix socket error", zap.Error(err))
}
// log level and "init unix socket", "path" is used in GnetcliStarter
// also should be placed after the listener creation to avoid race condition
// when GnetcliStarter client tries to connect to a socket that does not exist yet
logger.Warn("init unix socket", zap.String("path", cfg.UnixSocket))
grpcListeners = append(grpcListeners, unixSocketLn)
}
var gatewayServer *http.Server
Expand All @@ -139,7 +141,7 @@ func main() {
if err != nil {
logger.Panic("tcp socket error", zap.Error(err))
}
// log level and "init tcp socket", "address" is used in gnetcli_adapter
// log level and "init tcp socket", "address" is used in GnetcliStarter
logger.Warn("init tcp socket", zap.String("address", tcpSocketLn.Addr().String()))
grpcListeners = append(grpcListeners, tcpSocketLn)
if cfg.HttpListen != "" {
Expand Down
Loading