Add geoip.IsInitialized to expose if the databases have been loaded

This commit is contained in:
Daniel 2022-06-09 13:59:50 +02:00
parent c442a7e51c
commit b392a1e8ff

View file

@ -26,3 +26,8 @@ func GetLocation(ip net.IP) (*Location, error) {
record.FillMissingInfo()
return record, nil
}
// IsInitialized returns whether the geoip database has been initialized.
func IsInitialized(v6, wait bool) bool {
return worker.GetReader(v6, wait) != nil
}