Make lookups more idempotent on update requests. (#2954)

* No longer fails if an update fails but it shouldn't have replaced it
This commit is contained in:
Charles Allen 2016-05-11 11:22:35 -07:00 committed by Xavier Léauté
parent f2510cf125
commit 81cab8a7bb
1 changed files with 2 additions and 1 deletions

View File

@ -118,7 +118,8 @@ class LookupListeningResource extends ListenerResource
for (final String name : lookups.keySet()) {
final LookupExtractorFactory factory = lookups.get(name);
try {
if (!manager.updateIfNew(name, factory)) {
// Only fail if it should have updated but didn't.
if (!manager.updateIfNew(name, factory) && factory.replaces(manager.get(name))) {
failedUpdates.put(name, factory);
}
}