Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
id
auth
Commits
e259b416
Commit
e259b416
authored
Jan 11, 2018
by
ale
Browse files
Add command-line option to set request timeout
parent
6cde90b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
cmd/auth-server/main.go
View file @
e259b416
...
...
@@ -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
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment