diff --git a/nise-backend/src/main/kotlin/com/nisemoe/nise/scheduler/GlobalCache.kt b/nise-backend/src/main/kotlin/com/nisemoe/nise/scheduler/GlobalCache.kt index 40a4a8a..b23a7c5 100644 --- a/nise-backend/src/main/kotlin/com/nisemoe/nise/scheduler/GlobalCache.kt +++ b/nise-backend/src/main/kotlin/com/nisemoe/nise/scheduler/GlobalCache.kt @@ -29,12 +29,11 @@ class GlobalCache( var statistics: Statistics? = null var rssFeed: RssFeed? = null - val stopwatch = StopWatch() - // 10 minutes to ms = 600000 @Scheduled(fixedDelay = 600000, initialDelay = 0) fun updateCaches() { - this.stopwatch.start() + val stopwatch = StopWatch() + stopwatch.start() logger.info("Updating the cache!") runBlocking { @@ -49,7 +48,7 @@ class GlobalCache( suspiciousScores = suspiciousScoresDeferred.await() } - this.stopwatch.stop() + stopwatch.stop() logger.info("Cache updated in {} seconds", String.format("%.2f", stopwatch.totalTimeSeconds)) } diff --git a/nise-backend/src/main/kotlin/com/nisemoe/nise/scheduler/ImportUsers.kt b/nise-backend/src/main/kotlin/com/nisemoe/nise/scheduler/ImportUsers.kt index 6b8bf7d..86f7fce 100644 --- a/nise-backend/src/main/kotlin/com/nisemoe/nise/scheduler/ImportUsers.kt +++ b/nise-backend/src/main/kotlin/com/nisemoe/nise/scheduler/ImportUsers.kt @@ -12,7 +12,6 @@ import org.springframework.beans.factory.annotation.Value import org.springframework.context.annotation.Profile import org.springframework.scheduling.annotation.Scheduled import org.springframework.stereotype.Service -import java.time.LocalDateTime import java.time.OffsetDateTime @Service @@ -80,7 +79,7 @@ class ImportUsers( val bannedUsersCondition = SCORES.IS_BANNED.eq(true) val usersResult = this.osuApi.getUsersBatch(userIds) - Thread.sleep(SLEEP_AFTER_API_CALL) + Thread.sleep(SLEEP_AFTER_API_CALL * 2) if (usersResult == null) { this.logger.error("Failed to get users")