8000 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
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
Next Next commit
setting Sdk key inside pollingConfigManager to make sure that the sdk…
…Key for a particular config is always same.
  • Loading branch information
NomanShoaib committed Jan 25, 2023
commit dd6a823688a7e31dba66ec1fa8f75df6174e38b0
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public abstract class PollingProjectConfigManager implements ProjectConfigManage

private final CountDownLatch countDownLatch = new CountDownLatch(1);

private volatile String sdkKey;
private volatile boolean started;
private ScheduledFuture<?> scheduledFuture;

Expand Down Expand Up @@ -120,8 +121,9 @@ void setConfig(ProjectConfig projectConfig) {
currentProjectConfig.set(projectConfig);
currentOptimizelyConfig.set(new OptimizelyConfigService(projectConfig).getConfig());
countDownLatch.countDown();
if (projectConfig.getSdkKey() != null) {
NotificationRegistry.getInternalNotificationCenter(projectConfig.getSdkKey()).send(SIGNAL);

if (sdkKey != null) {
NotificationRegistry.getInternalNotificationCenter(sdkKey).send(SIGNAL);
}
notificationCenter.send(SIGNAL);
}
Expand Down Expand Up @@ -203,6 +205,10 @@ public synchronized void close() {
started = false;
}

protected void setSdkKey(String sdkKey) {
this.sdkKey = sdkKey;
}

public boolean isRunning() {
return started;
}
Expand Down
0