moresandeep commented on a change in pull request #257: KNOX-2214 - Periodic
job to evict expired tokens
URL: https://github.com/apache/knox/pull/257#discussion_r377088643
##########
File path:
gateway-server/src/main/java/org/apache/knox/gateway/services/token/impl/DefaultTokenStateService.java
##########
@@ -43,9 +48,19 @@
private final Map<String, Long> maxTokenLifetimes = new HashMap<>();
+ /* token eviction interval in seconds, default is 5 mins */
+ private long tokenEvictionInterval;
+
+ private final ScheduledExecutorService evictionScheduler =
Executors.newScheduledThreadPool(1);
+
@Override
public void init(final GatewayConfig config, final Map<String, String>
options) throws ServiceLifecycleException {
+ tokenEvictionInterval = config.getKnoxTokenEvictionInterval();
+ if (tokenEvictionInterval > 0) {
Review comment:
This probably should go in start() method.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services