make Close satisfy io.Closer

This commit is contained in:
vyzo
2020-11-06 22:26:24 +02:00
parent 9149ae2164
commit 08aab1c48a
+3 -1
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