Use minimum build number when merging master indexes

Some master indexes are used across multiple builds. It makes sense to
use the minimum build number, much like how we use the minimum
timestamp.

Signed-off-by: Graham <gpe@openrs2.org>
bzip2
Graham 4 years ago
parent c06417bed7
commit 25ee52738d
  1. 4
      archive/src/main/kotlin/org/openrs2/archive/cache/CacheImporter.kt

@ -27,6 +27,7 @@ import java.time.OffsetDateTime
import java.time.ZoneOffset
import javax.inject.Inject
import javax.inject.Singleton
import kotlin.math.min
@Singleton
public class CacheImporter @Inject constructor(
@ -376,8 +377,7 @@ public class CacheImporter @Inject constructor(
check(oldGameId == gameId)
if (oldBuild != null && build != null) {
check(oldBuild == build)
newBuild = oldBuild
newBuild = min(oldBuild, build)
} else if (oldBuild != null) {
newBuild = oldBuild
} else {

Loading…
Cancel
Save