696469aae7
It was possible for NewEvents to never return, blocked on waiting for a WaitGroup to be done. The call to Done was in a goroutine that could exit before reaching the Done call. Replace the WaitGroup with a channel that is closed to signal that initialisation is complete. Also, while we are waiting on the channel, wait on the context so we can exit clealy if the context is canceled. |
||
---|---|---|
.. | ||
state | ||
events_called.go | ||
events_height.go | ||
events_test.go | ||
events.go | ||
tscache_test.go | ||
tscache.go | ||
utils.go |