Commit e259b416 authored by ale's avatar ale
Browse files

Add command-line option to set request timeout

parent 6cde90b8
......@@ -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 {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment