Merge pull request #101 from farcaller/patch-1

Made slack timeout configurable
This commit is contained in:
Julius Volz 2015-07-27 12:40:41 +02:00
commit 2eb7962ed0

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,
}