[build test] 1.18
This commit is contained in:
parent
016862f7a5
commit
2f24e49ff6
2 changed files with 11 additions and 1 deletions
|
@ -146,6 +146,16 @@ func Init(dir string) error {
|
|||
f.Write([]byte(`mixed-port: 7890`))
|
||||
f.Close()
|
||||
}
|
||||
buf, _ := os.ReadFile(C.Path.Config())
|
||||
rawCfg, err := UnmarshalRawConfig(buf)
|
||||
if err != nil {
|
||||
log.Errorln(err.Error())
|
||||
fmt.Printf("configuration file %s test failed\n", C.Path.Config())
|
||||
os.Exit(1)
|
||||
}
|
||||
if !C.GeodataMode {
|
||||
C.GeodataMode = rawCfg.GeodataMode
|
||||
}
|
||||
// initial GeoIP
|
||||
if err := initGeoIP(); err != nil {
|
||||
return fmt.Errorf("can't initial GeoIP: %w", err)
|
||||
|
|
2
main.go
2
main.go
|
@ -73,7 +73,7 @@ func main() {
|
|||
C.SetConfig(configFile)
|
||||
}
|
||||
|
||||
if geodataMode || executor.GetGeneral().GeodataMode {
|
||||
if geodataMode {
|
||||
C.GeodataMode = true
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue