fix: geoip mmdb/geodata init

This commit is contained in:
metacubex
2023-01-09 21:07:31 +08:00
parent b4503908df
commit e9a7e104c0
6 changed files with 101 additions and 92 deletions

View File

@ -71,6 +71,11 @@ func (g *GEOIP) GetRecodeSize() int {
}
func NewGEOIP(country string, adapter string, noResolveIP bool) (*GEOIP, error) {
if err := geodata.InitGeoIP(); err != nil {
log.Errorln("can't initial GeoIP: %s", err)
return nil, err
}
if !C.GeodataMode || strings.EqualFold(country, "LAN") {
geoip := &GEOIP{
Base: &Base{},