10000 Fix: Added notificationRegistry to make sure that odpSettings updates by mnoman09 · Pull Request #501 · optimizely/java-sdk · GitHub
[go: up one dir, main page]

Skip to content

Fix: Added notificationRegistry to make sure that odpSettings updates #501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Refactored and moved getSdkKey to pollingConfigManager to make sure t…
…hat to trigger the notification always user provided sdkKey will be prioritized
  • Loading branch information
NomanShoaib committed Jan 25, 2023
commit 26d50ae26e0433451baa1c759b57f8d63f705f07
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ public OptimizelyConfig getOptimizelyConfig() {
return currentOptimizelyConfig.get();
}

@Override
public String getSDKKey() {
return this.sdkKey;
}

public synchronized void start() {
if (started) {
logger.warn("Manager already started.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public class HttpProjectConfigManager extends PollingProjectConfigManager {
private final URI uri;
private final String datafileAccessToken;
private String datafileLastModified;
private String sdkKey;

private HttpProjectConfigManager(long period,
TimeUnit timeUnit,
Expand All @@ -74,13 +73,11 @@ private HttpProjectConfigManager(long period,
String datafileAccessToken,
long blockingTimeoutPeriod,
TimeUnit blockingTimeoutUnit,
NotificationCenter notificationCenter,
String sdkKey) {
NotificationCenter notificationCenter) {
super(period, timeUnit, blockingTimeoutPeriod, blockingTimeoutUnit, notificationCenter);
this.httpClient = httpClient;
this.uri = URI.create(url);
this.datafileAccessToken = datafileAccessToken;
this.sdkKey = sdkKey;
}

public URI getUri() {
Expand Down Expand Up @@ -170,11 +167,6 @@ public static Builder builder() {
return new Builder();
}

@Override
public String getSDKKey() {
return this.sdkKey;
}

public static class Builder {
private String datafile;
private String url;
Expand Down Expand Up @@ -364,8 +356,7 @@ public HttpProjectConfigManager build(boolean defer) {
datafileAccessToken,
blockingTimeoutPeriod,
blockingTimeoutUnit,
notificationCenter,
sdkKey);
notificationCenter);
httpProjectManager.setSdkKey(sdkKey);
if (datafile != null) {
try {
Expand Down
0