mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
dispatch: Fix intermittent TestMuxPublish issue (#1412)
* Dispatch: Assertify TestMuxPublish * Dispatch: Fix errDispatcherJobsAtLimit test fails This test would fail intermittently when the jobs queue drained quickly enough. This sets the overload ceiling based on the default settings, and seems a safe way of ensuring we get an error every time. It adds a done channel guard around the goro test because otherwise we'll get a panic occassionally when the goro outlives TestMaxPublish * Dispatch: Add test for Publish receiving data * Dispatch: Publish to all subscribers
This commit is contained in:
@@ -180,11 +180,9 @@ func (d *Dispatcher) relayer() {
|
||||
continue
|
||||
}
|
||||
for i := range pipes {
|
||||
select {
|
||||
case pipes[i] <- j.Data:
|
||||
default:
|
||||
// no receiver; don't wait. This limits complexity.
|
||||
}
|
||||
go func(p chan any) {
|
||||
p <- j.Data
|
||||
}(pipes[i])
|
||||
}
|
||||
d.rMtx.RUnlock()
|
||||
case <-d.shutdown:
|
||||
|
||||
Reference in New Issue
Block a user