Fix geoip close

This commit is contained in:
世界 2024-01-01 21:36:06 +08:00
parent c506255e0f
commit 40c7f3e170
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
2 changed files with 5 additions and 1 deletions

View file

@ -32,3 +32,7 @@ func (r *Reader) Lookup(addr netip.Addr) string {
} }
return "unknown" return "unknown"
} }
func (r *Reader) Close() error {
return r.reader.Close()
}

View file

@ -535,7 +535,7 @@ func (r *Router) Close() error {
} }
if r.geoIPReader != nil { if r.geoIPReader != nil {
r.logger.Trace("closing geoip reader") r.logger.Trace("closing geoip reader")
err = E.Append(err, common.Close(r.geoIPReader), func(err error) error { err = E.Append(err, r.geoIPReader.Close(), func(err error) error {
return E.Cause(err, "close geoip reader") return E.Cause(err, "close geoip reader")
}) })
} }