refactor: `schedule()` doesn't have to wait for `sf.term`

This commit is contained in:
Arran Schlosberg 2024-11-27 11:10:56 +00:00
parent 86da86c4ac
commit fde127e9b9
No known key found for this signature in database
GPG Key ID: 5DD5567C12C5F312
1 changed files with 2 additions and 0 deletions

View File

@ -290,6 +290,8 @@ func (sf *subfetcher) schedule(addrs []common.Address, slots []common.Hash, read
select {
case sf.tasks <- tasks:
return nil
case <-sf.stop:
return errTerminated // imminently so no need to wait for sf.term
case <-sf.term:
return errTerminated
}