Merge pull request #376 from safing/fix/geoip-async-update

Fix panic when nobody waits for a geoip database
This commit is contained in:
Daniel
2021-08-18 16:36:06 +02:00
committed by GitHub

View File

@@ -67,6 +67,9 @@ func (ub *updateBroadcaster) ReplaceDatabase(db *geoIPDB) {
// notifyWaiters notifies and removes all waiters. Must be called
// with ub.rw locked.
func (ub *updateBroadcaster) notifyWaiters() {
if ub.waiter == nil {
return
}
waiter := ub.waiter
ub.waiter = nil
close(waiter)