Skip to content

Commit

Permalink
do not retry config parsing
Browse files Browse the repository at this point in the history
Signed-off-by: Kai Kreuzer <kai@openhab.org>
  • Loading branch information
kaikreuzer committed Nov 16, 2020
1 parent d8a6a14 commit 79c256b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class ExpireManager implements EventSubscriber, RegistryChangeListener<It

private final Logger logger = LoggerFactory.getLogger(ExpireManager.class);

private Map<String, ExpireConfig> itemExpireConfig = new ConcurrentHashMap<>();
private Map<String, @Nullable ExpireConfig> itemExpireConfig = new ConcurrentHashMap<>();
private Map<String, Instant> itemExpireMap = new ConcurrentHashMap<>();

private ScheduledExecutorService threadPool = ThreadPoolManager
Expand Down Expand Up @@ -195,6 +195,8 @@ protected void receiveUpdate(ItemStateEvent stateEvent) {
logger.debug("Item '{}' does not exist.", itemName);
}
}
// also fill the map when there is no config, so that we do not retry to find one
itemExpireConfig.put(itemName, null);
return null;
}
}
Expand Down Expand Up @@ -356,6 +358,7 @@ public String toString() {

@Override
public void added(Item item) {
itemExpireConfig.remove(item.getName());
}

@Override
Expand Down

0 comments on commit 79c256b

Please sign in to comment.