forked from gausby/tortoise
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cap the max reconnect rate by delaying before the first connect
If the Connection GenServer crashes or stops due to an error it gets restarted immediately. This is problematic when remaking the connection immediately doesn't allow the issue to resolve itself. A trivial way of relieving the issue is to add a short manditory reconnect delay. Since the delay is mandatory, it can't be long. Given typical connect times, the default of 1 second probably won't be noticed. 50% jitter is added. The delay can be changed using the `:first_connect_delay` option.
- Loading branch information
1 parent
1a60f2c
commit e58fcdb
Showing
2 changed files
with
56 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters