Skip to content

Commit

Permalink
Merge pull request #131 from kevinburke/disable-rpc
Browse files Browse the repository at this point in the history
main: add option to disable RPC server
  • Loading branch information
mattn authored May 1, 2022
2 parents e383290 + 8e8896e commit 97a5f26
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions _example/web.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build ignore
// +build ignore

package main
Expand Down
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ var procfile = flag.String("f", "Procfile", "proc file")
// rpc port number.
var port = flag.Uint("p", defaultPort(), "port")

var startRPCServer = flag.Bool("rpc-server", true, "Start an RPC server listening on "+defaultAddr())

// base directory
var basedir = flag.String("basedir", "", "base directory")

Expand Down Expand Up @@ -264,7 +266,9 @@ func start(ctx context.Context, sig <-chan os.Signal, cfg *config) error {
}
godotenv.Load()
rpcChan := make(chan *rpcMessage, 10)
go startServer(ctx, rpcChan, cfg.Port)
if *startRPCServer {
go startServer(ctx, rpcChan, cfg.Port)
}
procsErr := startProcs(sig, rpcChan, cfg.ExitOnError)
return procsErr
}
Expand Down
1 change: 1 addition & 0 deletions proc_posix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

package main
Expand Down

0 comments on commit 97a5f26

Please sign in to comment.