Skip to content

Commit

Permalink
Update configuration documentation to describe the usage of STREAMING…
Browse files Browse the repository at this point in the history
…_DELAY_SECONDS
  • Loading branch information
Moshe Good committed Feb 11, 2024
1 parent 908e57d commit 2976a5e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ For **Duration** settings, the value should be be an integer followed by `ms`, `
| `logLevel` | `LOG_LEVEL` | String | `info` | Should be `debug`, `info`, `warn`, `error`, or `none`. To learn more, read [Logging](./logging.md). |
| `bigSegmentsStaleAsDegraded` | `BIG_SEGMENTS_STALE_AS_DEGRADED` | Boolean | `false` | Indicates if environments should be considered degraded if Big Segments are not fully synchronized. |
| `bigSegmentsStaleThreshold` | `BIG_SEGMENTS_STALE_THRESHOLD` | Duration | `5m` | Indicates how long until Big Segments should be considered stale. |
| n/a | `STREAMING_DELAY_SECONDS` | Number | `0` | The minimum number of seconds before responding to a new client connection. Used only in proxy mode for streaming clients. Useful for reducing memory when under heavy load, as many clients can share a single data fetch. Maximum value is 60. |

_(1)_ The default values for `streamUri`, `baseUri`, and `clientSideBaseUri` are `https://stream.launchdarkly.com`, `https://sdk.launchdarkly.com`, and `https://clientsdk.launchdarkly.com`, respectively. You should never need to change these URIs unless you are either using a special instance of the LaunchDarkly service, in which case Support will tell you how to set them, or you are accessing LaunchDarkly using a reverse proxy or some other mechanism that rewrites URLs.

Expand Down
4 changes: 2 additions & 2 deletions internal/streams/stream_provider_server_side.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ func (r *serverSideEnvStreamRepository) getReplayEvent() (eventsource.Event, err
event := MakeServerSidePutEvent(allData)
// So we sleep for a bit to allow a bunch of concurrent calls to
// all make use of this same flightGroup.
delayS := os.Getenv("LD_STREAMING_DELAY_SECONDS")
delayS := os.Getenv("STREAMING_DELAY_SECONDS")
if delay, err := strconv.Atoi(delayS); err == nil {
if delay > 0 && delay <= 60 {
time.Sleep(time.Duration(delay)*time.Second - time.Since(start))
} else {
r.loggers.Warnf("Ignoring invalid value for LD_STREAMING_DELAY_SECONDS: %s", delayS)
r.loggers.Warnf("Ignoring invalid value for STREAMING_DELAY_SECONDS: %s", delayS)
}
}

Expand Down

0 comments on commit 2976a5e

Please sign in to comment.