summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/slack-go/slack/websocket_managed_conn.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2021-02-01 21:29:04 +0100
committerGitHub <noreply@github.com>2021-02-01 21:29:04 +0100
commit0452be0cb383ff560e340b643b60a35c6e228639 (patch)
tree41b91af43c2e321d6498a6b56594b1d0c71c516e /vendor/github.com/slack-go/slack/websocket_managed_conn.go
parent1624f107739b8ed7b142732430e5295764388de2 (diff)
downloadmatterbridge-msglm-0452be0cb383ff560e340b643b60a35c6e228639.tar.gz
matterbridge-msglm-0452be0cb383ff560e340b643b60a35c6e228639.tar.bz2
matterbridge-msglm-0452be0cb383ff560e340b643b60a35c6e228639.zip
Update vendor (#1384)
Diffstat (limited to 'vendor/github.com/slack-go/slack/websocket_managed_conn.go')
-rw-r--r--vendor/github.com/slack-go/slack/websocket_managed_conn.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/vendor/github.com/slack-go/slack/websocket_managed_conn.go b/vendor/github.com/slack-go/slack/websocket_managed_conn.go
index 8607b3a3..fe6802e4 100644
--- a/vendor/github.com/slack-go/slack/websocket_managed_conn.go
+++ b/vendor/github.com/slack-go/slack/websocket_managed_conn.go
@@ -9,6 +9,9 @@ import (
"reflect"
"time"
+ "github.com/slack-go/slack/internal/backoff"
+ "github.com/slack-go/slack/internal/misc"
+
"github.com/gorilla/websocket"
"github.com/slack-go/slack/internal/errorsx"
"github.com/slack-go/slack/internal/timex"
@@ -92,7 +95,7 @@ func (rtm *RTM) connect(connectionCount int, useRTMStart bool) (*Info, *websocke
// used to provide exponential backoff wait time with jitter before trying
// to connect to slack again
- boff := &backoff{
+ boff := &backoff.Backoff{
Max: 5 * time.Minute,
}
@@ -103,7 +106,7 @@ func (rtm *RTM) connect(connectionCount int, useRTMStart bool) (*Info, *websocke
// send connecting event
rtm.IncomingEvents <- RTMEvent{"connecting", &ConnectingEvent{
- Attempt: boff.attempts + 1,
+ Attempt: boff.Attempts() + 1,
ConnectionCount: connectionCount,
}}
@@ -123,7 +126,7 @@ func (rtm *RTM) connect(connectionCount int, useRTMStart bool) (*Info, *websocke
}
switch actual := err.(type) {
- case statusCodeError:
+ case misc.StatusCodeError:
if actual.Code == http.StatusNotFound {
rtm.Debugf("invalid auth when connecting with RTM: %s", err)
rtm.IncomingEvents <- RTMEvent{"invalid_auth", &InvalidAuthEvent{}}
@@ -138,13 +141,13 @@ func (rtm *RTM) connect(connectionCount int, useRTMStart bool) (*Info, *websocke
// any other errors are treated as recoverable and we try again after
// sending the event along the IncomingEvents channel
rtm.IncomingEvents <- RTMEvent{"connection_error", &ConnectionErrorEvent{
- Attempt: boff.attempts,
+ Attempt: boff.Attempts(),
Backoff: backoff,
ErrorObj: err,
}}
// get time we should wait before attempting to connect again
- rtm.Debugf("reconnection %d failed: %s reconnecting in %v\n", boff.attempts, err, backoff)
+ rtm.Debugf("reconnection %d failed: %s reconnecting in %v\n", boff.Attempts(), err, backoff)
// wait for one of the following to occur,
// backoff duration has elapsed, killChannel is signalled, or