make Close satisfy io.Closer
This commit is contained in:
parent
9149ae2164
commit
08aab1c48a
@ -59,12 +59,14 @@ func (c *HeadChangeCoalescer) HeadChange(revert, apply []*types.TipSet) error {
|
|||||||
|
|
||||||
// Close closes the coalescer and cancels the background dispatch goroutine.
|
// Close closes the coalescer and cancels the background dispatch goroutine.
|
||||||
// Any further notification will result in an error.
|
// Any further notification will result in an error.
|
||||||
func (c *HeadChangeCoalescer) Close() {
|
func (c *HeadChangeCoalescer) Close() error {
|
||||||
select {
|
select {
|
||||||
case <-c.ctx.Done():
|
case <-c.ctx.Done():
|
||||||
default:
|
default:
|
||||||
c.cancel()
|
c.cancel()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Implementation details
|
// Implementation details
|
||||||
|
Loading…
Reference in New Issue
Block a user