Made slack timeout configurable

This commit is contained in:
Vladimir Pouzanov 2015-07-22 22:09:46 +01:00
parent 412d63a6dc
commit 64e606d8f1
1 changed files with 2 additions and 1 deletions

View File

@ -89,6 +89,7 @@ var (
flowdockURL = flag.String("notification.flowdock.url", "https://api.flowdock.com/v1/messages/team_inbox", "Flowdock API V1 URL.")
pushoverRetryTimeout = flag.Int("notification.pushover.retry-interval", 60, "Interval in seconds at which Pushover should retry pushing a message to receiving users.")
pushoverExpireTimeout = flag.Int("notification.pushover.retry-expiry-interval", 7200, "Timeout after which unacknowledged Pushover messages will not be retried further.")
slackConnectTimeout = flag.Int("notification.slack.timeout", 10, "HTTP timeout to talk to Slack (in seconds).")
)
type notificationOp int
@ -341,7 +342,7 @@ func (n *notifier) sendSlackNotification(op notificationOp, config *pb.SlackConf
return err
}
timeout := time.Duration(5 * time.Second)
timeout := time.Duration(*slackConnectTimeout) * time.Second
client := http.Client{
Timeout: timeout,
}