Skip to content

Commit

Permalink
prepare 4.17.0 release (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
LaunchDarklyCI authored Mar 30, 2020
1 parent 3984042 commit c2110ab
Show file tree
Hide file tree
Showing 40 changed files with 1,955 additions and 1,018 deletions.
21 changes: 18 additions & 3 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

[[constraint]]
name = "github.com/launchdarkly/eventsource"
version = "1.1.0"
version = "1.4.0"

[[constraint]]
name = "github.com/patrickmn/go-cache"
Expand All @@ -48,3 +48,7 @@
[[constraint]]
name = "github.com/stretchr/testify"
version = "1.2.1"

[[constraint]]
name = "github.com/launchdarkly/go-test-helpers"
version = "1.0.0"
9 changes: 9 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ type Config struct {
// Sets whether streaming mode should be enabled. By default, streaming is enabled. It should only be
// disabled on the advice of LaunchDarkly support.
Stream bool
// Sets the initial reconnect delay for the streaming connection.
//
// The streaming service uses a backoff algorithm (with jitter) every time the connection needs
// to be reestablished. The delay for the first reconnection will start near this value, and then
// increase exponentially for any subsequent connection failures (up to a maximum of 30 seconds).
//
// This value is ignored if streaming is disabled. If it is zero, the default of 1 second is used.
StreamInitialReconnectDelay time.Duration
// Sets whether this client should use the LaunchDarkly relay in daemon mode. In this mode, the client does
// not subscribe to the streaming or polling API, but reads data only from the feature store. See:
// https://docs.launchdarkly.com/docs/the-relay-proxy
Expand Down Expand Up @@ -202,6 +210,7 @@ var DefaultConfig = Config{
PollInterval: MinimumPollInterval,
Timeout: 3000 * time.Millisecond,
Stream: true,
StreamInitialReconnectDelay: defaultStreamRetryDelay,
FeatureStore: nil,
UseLdd: false,
SendEvents: true,
Expand Down
2 changes: 1 addition & 1 deletion diagnostic_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func (m *diagnosticsManager) CreateInitEvent() diagnosticInitEvent {
PollingIntervalMillis: durationToMillis(m.config.PollInterval),
StartWaitMillis: durationToMillis(m.startWaitTime),
SamplingInterval: m.config.SamplingInterval,
ReconnectTimeMillis: 3000,
ReconnectTimeMillis: durationToMillis(m.config.StreamInitialReconnectDelay),
StreamingDisabled: !m.config.Stream,
UsingRelayDaemon: m.config.UseLdd,
Offline: m.config.Offline,
Expand Down
3 changes: 2 additions & 1 deletion diagnostic_events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func expectedDiagnosticConfigForDefaultConfig() diagnosticConfigData {
PollingIntervalMillis: durationToMillis(DefaultConfig.PollInterval),
StartWaitMillis: milliseconds(5000),
SamplingInterval: 0,
ReconnectTimeMillis: 3000,
ReconnectTimeMillis: durationToMillis(DefaultConfig.StreamInitialReconnectDelay),
StreamingDisabled: false,
UsingRelayDaemon: false,
Offline: false,
Expand Down Expand Up @@ -104,6 +104,7 @@ func TestDiagnosticEventCustomConfig(t *testing.T) {
}},
{func(c *Config) { c.FlushInterval = time.Second }, func(d *diagnosticConfigData) { d.EventsFlushIntervalMillis = 1000 }},
{func(c *Config) { c.PollInterval = time.Second }, func(d *diagnosticConfigData) { d.PollingIntervalMillis = 1000 }},
{func(c *Config) { c.StreamInitialReconnectDelay = time.Minute }, func(d *diagnosticConfigData) { d.ReconnectTimeMillis = 60000 }},
{func(c *Config) { c.SamplingInterval = 2 }, func(d *diagnosticConfigData) { d.SamplingInterval = 2 }},
{func(c *Config) { c.Stream = false }, func(d *diagnosticConfigData) { d.StreamingDisabled = true }},
{func(c *Config) { c.UseLdd = true }, func(d *diagnosticConfigData) { d.UsingRelayDaemon = true }},
Expand Down
Loading

0 comments on commit c2110ab

Please sign in to comment.