private boolean isScheduled(NearCache nearCache, long now) { NearCacheStats nearCacheStats = nearCache.getNearCacheStats(); if (nearCacheStats.getLastPersistenceTime() == 0) { // check initial delay seconds for first persistence long runningSeconds = MILLISECONDS.toSeconds(now - started); if (runningSeconds < preloaderConfig.getStoreInitialDelaySeconds()) { return false; } } else { // check interval seconds for all other persistences long elapsedSeconds = MILLISECONDS.toSeconds(now - nearCacheStats.getLastPersistenceTime()); if (elapsedSeconds < preloaderConfig.getStoreIntervalSeconds()) { return false; } } return true; } }
private boolean isScheduled(NearCache nearCache, long now) { NearCacheStats nearCacheStats = nearCache.getNearCacheStats(); NearCachePreloaderConfig preloaderConfig = nearCache.getPreloaderConfig(); if (nearCacheStats.getLastPersistenceTime() == 0) { // check initial delay seconds for first persistence long runningSeconds = MILLISECONDS.toSeconds(now - started); if (runningSeconds < preloaderConfig.getStoreInitialDelaySeconds()) { return false; } } else { // check interval seconds for all other persistences long elapsedSeconds = MILLISECONDS.toSeconds(now - nearCacheStats.getLastPersistenceTime()); if (elapsedSeconds < preloaderConfig.getStoreIntervalSeconds()) { return false; } } return true; } }