Skip to content

Commit

Permalink
jobberrunner: Specifying socket for IPC is no longer required
Browse files Browse the repository at this point in the history
- If not specified, IPC server won't be launched.
  • Loading branch information
dshearer committed May 10, 2020
1 parent 6d60633 commit 9c740a1
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions jobberrunner/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ func main() {
arg.MustParse(&args)

// check for errors
if (args.UnixSocket == nil) == (args.TcpPort == nil) {
fmt.Fprintf(os.Stderr, "Must specify exactly one of --unixsocket or --tcpport\n")
if args.UnixSocket != nil && args.TcpPort != nil {
fmt.Fprintf(os.Stderr, "Must specify at most one of --unixsocket or --tcpport\n")
quit(1)
}
if args.UnixSocket != nil && len(*args.UnixSocket) == 0 {
Expand Down Expand Up @@ -173,13 +173,15 @@ func main() {
if args.UnixSocket != nil {
gIpcServer = NewUdsIpcServer(*args.UnixSocket, gJobManager.CmdChan)
common.Logger.Printf("Listening for commands on %v", *args.UnixSocket)
} else {
} else if args.TcpPort != nil {
gIpcServer = NewInetIpcServer(*args.TcpPort, gJobManager.CmdChan)
common.Logger.Printf("Listening for commands on :%v", *args.TcpPort)
}
if err := gIpcServer.Launch(); err != nil {
common.ErrLogger.Printf("Error: %v", err)
quit(1)
if gIpcServer != nil {
if err := gIpcServer.Launch(); err != nil {
common.ErrLogger.Printf("Error: %v", err)
quit(1)
}
}

if args.QuitSocket != nil {
Expand Down

0 comments on commit 9c740a1

Please sign in to comment.