Commit af6e6f0b authored by Steven Allen's avatar Steven Allen

avoid publishing if notification system has been shut down

(will deadlock)

License: MIT
Signed-off-by: default avatarSteven Allen <steven@stebalien.com>
parent ab65a184
......@@ -36,6 +36,16 @@ type impl struct {
}
func (ps *impl) Publish(block blocks.Block) {
ps.wg.Add(1)
defer ps.wg.Done()
select {
case <-ps.cancel:
// Already shutdown, bail.
return
default:
}
ps.wrapped.Pub(block, block.Cid().KeyString())
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment