Skip to content

Commit

Permalink
feat: set SSE connections as the default (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathannorris authored Jan 20, 2025
1 parent b6d12c8 commit 8783e71
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public boolean isConfigInitialized() {
private ProjectConfig getConfig() throws DevCycleException {
Call<ProjectConfig> config = this.configApiClient.getConfig(this.sdkKey, this.configETag, this.configLastModified);
this.config = getResponseWithRetries(config, 1);
if (this.options.isEnableBetaRealtimeUpdates()) {
if (!this.options.isDisableRealtimeUpdates()) {
try {
URI uri = new URI(this.config.getSse().getHostname() + this.config.getSse().getPath());
if (sseManager == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ public class DevCycleLocalOptions implements IDevCycleOptions {

private boolean disableAutomaticEventLogging = false;

private boolean disableRealtimeUpdates = false;

/**
* @deprecated real time updates are enabled by default now
*/
@Deprecated
private boolean enableBetaRealtimeUpdates = false;

@JsonIgnore
Expand All @@ -52,7 +58,9 @@ public DevCycleLocalOptions(
boolean disableCustomEventLogging,
IDevCycleLogger customLogger,
IRestOptions restOptions,
boolean enableBetaRealtimeUpdates
@Deprecated
boolean enableBetaRealtimeUpdates,
boolean disableRealtimeUpdates
) {
this.configRequestTimeoutMs = configRequestTimeoutMs > 0 ? configRequestTimeoutMs : this.configRequestTimeoutMs;
this.configPollingIntervalMS = getConfigPollingIntervalMS(configPollingIntervalMs, configPollingIntervalMS);
Expand All @@ -67,6 +75,7 @@ public DevCycleLocalOptions(
this.customLogger = customLogger;
this.restOptions = restOptions;
this.enableBetaRealtimeUpdates = enableBetaRealtimeUpdates;
this.disableRealtimeUpdates = disableRealtimeUpdates;

if (this.flushEventQueueSize >= this.maxEventQueueSize) {
DevCycleLogger.warning("flushEventQueueSize: " + this.flushEventQueueSize + " must be smaller than maxEventQueueSize: " + this.maxEventQueueSize);
Expand Down

0 comments on commit 8783e71

Please sign in to comment.