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

Loading…
Cancel
Save