Skip to content
This repository was archived by the owner on Apr 12, 2023. It is now read-only.

Commit 6efe1d3

Browse files
committed
Limit the time between reconnections
Close #48.
1 parent a08ccdc commit 6efe1d3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/service/slack/slack-account.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,17 @@ class SlackAccount extends Account {
4747
super(service, {id: data.team_id, name: data.team})
4848

4949
// Start real time client.
50-
this.rtm = new RTMClient(config ? config.token : token)
50+
const options = {
51+
retryConfig: {maxRetryTime: 1000},
52+
maxRequestConcurrency: 10,
53+
}
54+
this.rtm = new RTMClient(config ? config.token : token, options)
5155
require('./private-apis').extend(this.rtm)
5256
this.rtm.once('unable_to_rtm_start', this.reportError.bind(this))
5357
this.rtm.once('authenticated', this.ready.bind(this))
5458
this.rtm.start({batch_presence_aware: true})
5559

5660
// Indicate whether this is reconnection.
57-
// the ready method has been called.
5861
this.isReconnect = false
5962

6063
this.rtm.on('error', this.reportError.bind(this))

0 commit comments

Comments
 (0)