Skip to content
Snippets Groups Projects
Commit e259b416 authored by ale's avatar ale
Browse files

Add command-line option to set request timeout

parent 6cde90b8
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ import (
"os"
"os/signal"
"syscall"
"time"
"git.autistici.org/ai3/go-common/unix"
"github.com/coreos/go-systemd/daemon"
......@@ -21,6 +22,7 @@ var (
socketPath = flag.String("socket", "/run/auth/socket", "`path` to the UNIX socket to listen on")
systemdSocketActivation = flag.Bool("systemd-socket", false, "use SystemD socket activation")
httpAddr = flag.String("http-addr", "", "if not nil, bind an HTTP server to this `addr` for Prometheus metrics")
requestTimeout = flag.Duration("timeout", 5*time.Second, "timeout for incoming requests")
)
func usage() {
......@@ -58,6 +60,7 @@ func main() {
}
srv := unix.NewLineServer(server.NewSocketServer(authSrv))
srv.RequestTimeout = *requestTimeout
var sockSrv *unix.SocketServer
if *systemdSocketActivation {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment