Committed by
Gerrit Code Review
Retry returning AppId after reload triggered by cache miss
Change-Id: I5b5f872ccdd72ccbc8a09bd221821b24a841e04b
Showing
1 changed file
with
2 additions
and
1 deletions
... | @@ -99,6 +99,7 @@ public class DistributedApplicationIdStore | ... | @@ -99,6 +99,7 @@ public class DistributedApplicationIdStore |
99 | ApplicationId appId = appIds.get(id); | 99 | ApplicationId appId = appIds.get(id); |
100 | if (appId == null) { | 100 | if (appId == null) { |
101 | primeAppIds(); | 101 | primeAppIds(); |
102 | + return appIds.get(id); | ||
102 | } | 103 | } |
103 | return appId; | 104 | return appId; |
104 | } | 105 | } |
... | @@ -110,7 +111,7 @@ public class DistributedApplicationIdStore | ... | @@ -110,7 +111,7 @@ public class DistributedApplicationIdStore |
110 | 111 | ||
111 | private void primeAppIds() { | 112 | private void primeAppIds() { |
112 | for (DefaultApplicationId appId : appIdsByName.values()) { | 113 | for (DefaultApplicationId appId : appIdsByName.values()) { |
113 | - appIds.put(appId.id(), appId); | 114 | + appIds.putIfAbsent(appId.id(), appId); |
114 | } | 115 | } |
115 | } | 116 | } |
116 | 117 | ... | ... |
-
Please register or login to post a comment