core/filtermaps: fix hang in tests

Since the index can now be disabled at runtime, it is no longer safe
to just check the disabled field once.
This commit is contained in:
Felix Lange 2025-03-28 12:34:44 +01:00
parent f532e4439a
commit 80632aa17d

View file

@ -137,16 +137,17 @@ func (f *FilterMaps) SetBlockProcessing(blockProcessing bool) {
// WaitIdle blocks until the indexer is in an idle state while synced up to the // WaitIdle blocks until the indexer is in an idle state while synced up to the
// latest targetView. // latest targetView.
func (f *FilterMaps) WaitIdle() { func (f *FilterMaps) WaitIdle() {
if f.disabled {
f.closeWg.Wait()
return
}
for { for {
ch := make(chan bool) ch := make(chan bool)
f.waitIdleCh <- ch select {
case f.waitIdleCh <- ch:
if <-ch { if <-ch {
return return
} }
case <-f.disabledCh:
f.closeWg.Wait()
return
}
} }
} }