if(LicenseUtil.getLevel() <100){
return;
}
long start = System.currentTimeMillis();
Logger.info(this.getClass(), "Running CleanBlockCacheScheduledTask");
BlockDirectiveCache bdc= CacheLocator.getBlockDirectiveCache();
DotCacheAdministrator dca = CacheLocator.getCacheAdministrator();
Set<String> keys= dca.getKeys(bdc.getPrimaryGroup());
long x = 0;
for(String key : keys){
BlockDirectiveCacheObject bo = bdc.get(key);
if(bo != null && bo.getCreated() + (bo.getTtl() * 1000) < System.currentTimeMillis()) {
bdc.remove(key);
x++;
}
}
long end = System.currentTimeMillis();
Logger.info(this.getClass(), "Ending CleanBlockCacheScheduledTask - cleaned " + x + " entries in " + (end-start)/1000 + " seconds");