performance: Don't autoupdate multiplayer games more than a week old - they're inactive games

This commit is contained in:
Yair Morgenstern 2023-09-05 19:00:44 +03:00
parent 5cc57f9293
commit a4cc566a8a

View File

@ -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()) {""}