|
|
|
@ -19,6 +19,7 @@ import org.springframework.scheduling.annotation.Scheduled; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
@Service |
|
|
|
@ -37,7 +38,11 @@ public class GraphService { |
|
|
|
|
|
|
|
private final static Logger logger = LoggerFactory.getLogger(GraphService.class); |
|
|
|
|
|
|
|
@Scheduled(cron = "@hourly") |
|
|
|
@Scheduled(fixedRate = 1, timeUnit = TimeUnit.HOURS) |
|
|
|
public void purgeCacheSched() { |
|
|
|
purgeCache(); |
|
|
|
} |
|
|
|
|
|
|
|
@CacheEvict(value = {"graphs.usertime", "graphs.vip", "graphs.online", "graphs.usertime.connections"}, allEntries = true) |
|
|
|
public void purgeCache() { |
|
|
|
logger.info("Cache clean"); |
|
|
|
|