Only update the badges etag map if we didn't have an entry

This commit is contained in:
Ravi Khadiwala authored and Chris Eager committed 2026-10-13 10:38:06 -04:00
1 parent 031beed7e4
commit 55abc73cac
1 file changed
+1 -3
@@ -98,9 +98,7 @@ public class RemoteConfigurationGrpcService extends SimpleRemoteConfigurationGrp
.setEtag(etag(badges))
.build();
// This could race and multiple threads could decide to build-and-cache. That's fine, they should all calculate
// the same etag.
localeToBadgesEtag.put(locale, taggedBadges.getEtag());
localeToBadgesEtag.computeIfAbsent(locale, _ -> taggedBadges.getEtag());
return GetBadgesResponse.newBuilder().setTaggedBadges(taggedBadges).build();
}