We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0c9ee5a commit 2f4a6c4Copy full SHA for 2f4a6c4
rpc/handlers.go
@@ -7,6 +7,7 @@ import (
7
"encoding/json"
8
"fmt"
9
"log"
10
+ "maps"
11
"math"
12
"strings"
13
stdsync "sync"
@@ -194,9 +195,15 @@ func (h *Handler) Run(ctx context.Context) error {
194
195
feed.Tee(l1HeadsSub, h.l1Heads)
196
197
<-ctx.Done()
- for _, sub := range h.subscriptions {
198
+
199
+ h.mu.Lock()
200
+ subscriptions := maps.Values(h.subscriptions)
201
+ h.mu.Unlock()
202
203
+ for sub := range subscriptions {
204
sub.wg.Wait()
205
}
206
207
return nil
208
209
0 commit comments