lazily load the geoIP service

This commit is contained in:
Thibault Duplessis 2019-12-12 12:27:44 -06:00
parent b192b0c048
commit c46e52d7f0

View file

@ -9,7 +9,7 @@ import lila.common.IpAddress
final class GeoIP(config: GeoIP.Config) {
private val geoIp = MaxMindIpGeo(config.file, 0)
private lazy val geoIp = MaxMindIpGeo(config.file, 0)
private val cache: LoadingCache[IpAddress, Option[Location]] = Scaffeine()
.expireAfterAccess(config.cacheTtl)