make Close satisfy io.Closer

This commit is contained in:
vyzo 2020-11-04 13:58:44 +02:00
parent 9149ae2164
commit 08aab1c48a

View File

@ -59,12 +59,14 @@ func (c *HeadChangeCoalescer) HeadChange(revert, apply []*types.TipSet) error {
// Close closes the coalescer and cancels the background dispatch goroutine.
// Any further notification will result in an error.
func (c *HeadChangeCoalescer) Close() {
func (c *HeadChangeCoalescer) Close() error {
select {
case <-c.ctx.Done():
default:
c.cancel()
}
return nil
}
// Implementation details