Skip to content

Commit

Permalink
[fix] Add log for quota controller
Browse files Browse the repository at this point in the history
[enh] Add a cache for path without quota
  • Loading branch information
blavenie committed May 16, 2022
1 parent 5194306 commit 494fbfa
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.duniter.core.util.Preconditions;
import org.duniter.core.util.StringUtils;
import org.duniter.elasticsearch.dao.*;
import org.duniter.elasticsearch.model.RequestLog;
import org.duniter.elasticsearch.rest.security.RestSecurityController;
import org.duniter.elasticsearch.service.*;
import org.duniter.elasticsearch.synchro.SynchroService;
Expand Down Expand Up @@ -248,6 +249,12 @@ protected ScheduledActionFuture<?> createIndices() {
.createIndexIfNotExists();
}

if (pluginSettings.enableQuota() && pluginSettings.logRejectedRequests()) {
injector.getInstance(RequestLogService.class)
.deleteIndex()
.createIndexIfNotExists();
}

if (logger.isInfoEnabled()) {
logger.info("Reloading indices [OK]");
}
Expand Down Expand Up @@ -281,6 +288,11 @@ else if (pluginSettings.enableBlockchainIndexation() && pluginSettings.reloadBlo
.createIndexIfNotExists();
}

if (pluginSettings.enableQuota() && pluginSettings.logRejectedRequests()) {
injector.getInstance(RequestLogService.class)
.createIndexIfNotExists();
}

if (logger.isDebugEnabled()) {
logger.debug("Checking indices [OK]");
}
Expand Down

0 comments on commit 494fbfa

Please sign in to comment.