launchdarkly / ruby-eventsource

Server-Sent Events client for Ruby
Other
40 stars 16 forks source link

don't apply backoff delay before first connection attempt #21

Closed eli-darkly closed 3 years ago

eli-darkly commented 3 years ago

I noticed that unit tests were running slower than I'd expect. Turning on more verbose logging revealed that it was doing a sleep of 500-1000ms before each connection— in other words, it was applying the backoff delay too soon. This is causing unnecessary slowness in initial connections, both when used in the LaunchDarkly Ruby SDK and when used separately.