@Scheduled(fixedDelay=1000) private void checkCache(){
  if (lastCacheTime == null) {
    return;
  }
  long tEnd=System.currentTimeMillis();
  long tDelta=tEnd - lastCacheTime;
  double elapsedSeconds=tDelta / 1000.0;
  if (elapsedSeconds > 1.0 && !caching.isEmpty()) {
    logger.debug("flush log cache by timeout " + elapsedSeconds);
    flushCache();
  }
}

@ Scheduled ( fixedDelay = 1000 ) private void checkCache ( ) { if ( lastCacheTime == null ) { return ; } long tEnd = System . currentTimeMillis ( ) ; long tDelta = tEnd - lastCacheTime ; double elapsedSeconds = tDelta / 1000.0 ; if ( elapsedSeconds > 1.0 && ! caching . isEmpty ( ) ) { logger . debug ( "flush log cache by timeout " + elapsedSeconds ) ; flushCache ( ) ; } }
check cache ' s time if cache ' s time is old , call flushcache ( )
