Recover from panic on close

This commit is contained in:
Andrea Maria Piana 2023-07-17 10:34:39 +01:00
parent b26859fc6a
commit b7a0c8fa18
No known key found for this signature in database
GPG Key ID: AA6CCA6DE0E06424

View File

@ -241,6 +241,12 @@ func (d *DiscoveryV5) Stop() {
d.wg.Wait()
defer func() {
if r := recover(); r != nil {
d.log.Info("recovering from panic and quitting")
}
}()
close(d.peerCh)
}