This is an automated email from the ASF dual-hosted git repository. rcordier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 793d39f4c94838e8427e233415b98f415e1335af Author: Benoit Tellier <[email protected]> AuthorDate: Mon Apr 26 22:38:53 2021 +0700 JAMES-3467 Domain cache should include auto-detection This allows fully relying on the cache for remote addresses, that previously would have been attempting auto-detection all of the time. --- .../java/org/apache/james/domainlist/lib/AbstractDomainList.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/data/data-library/src/main/java/org/apache/james/domainlist/lib/AbstractDomainList.java b/server/data/data-library/src/main/java/org/apache/james/domainlist/lib/AbstractDomainList.java index 2a19598..9f371eb 100644 --- a/server/data/data-library/src/main/java/org/apache/james/domainlist/lib/AbstractDomainList.java +++ b/server/data/data-library/src/main/java/org/apache/james/domainlist/lib/AbstractDomainList.java @@ -97,7 +97,7 @@ public abstract class AbstractDomainList implements DomainList, Configurable { .build(new CacheLoader<>() { @Override public Boolean load(Domain key) throws DomainListException { - return containsDomainInternal(key); + return containsDomainInternal(key) || detectedDomainsContains(key); } }); @@ -169,8 +169,7 @@ public abstract class AbstractDomainList implements DomainList, Configurable { public boolean containsDomain(Domain domain) throws DomainListException { if (configuration.isCacheEnabled()) { try { - boolean internalAnswer = cache.get(domain); - return internalAnswer || detectedDomainsContains(domain); + return cache.get(domain); } catch (ExecutionException e) { if (e.getCause() instanceof DomainListException) { throw (DomainListException) e.getCause(); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
