From a4cc566a8a6246af63812a6225d80eedfc9aa388 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Tue, 5 Sep 2023 19:00:44 +0300 Subject: [PATCH] performance: Don't autoupdate multiplayer games more than a week old - they're inactive games --- android/src/com/unciv/app/MultiplayerTurnCheckWorker.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/android/src/com/unciv/app/MultiplayerTurnCheckWorker.kt b/android/src/com/unciv/app/MultiplayerTurnCheckWorker.kt index d7ccd5226e..563e8428be 100644 --- a/android/src/com/unciv/app/MultiplayerTurnCheckWorker.kt +++ b/android/src/com/unciv/app/MultiplayerTurnCheckWorker.kt @@ -189,7 +189,10 @@ class MultiplayerTurnCheckWorker(appContext: Context, workerParams: WorkerParame fun startTurnChecker(applicationContext: Context, files: UncivFiles, currentGameInfo: GameInfo, settings: GameSettingsMultiplayer) { Log.i(LOG_TAG, "startTurnChecker") + + val oneWeekWorthOfMilliseconds = 1000*60*60*24*7 val gameFiles = files.getMultiplayerSaves() + .filter { it.lastModified() > System.currentTimeMillis() - oneWeekWorthOfMilliseconds } val gameIds = Array(gameFiles.count()) {""} val gameNames = Array(gameFiles.count()) {""}