+1
-1
appview/state/state.go
+1
-1
appview/state/state.go
+5
jetstream/jetstream.go
+5
jetstream/jetstream.go
···
43
43
return
44
44
}
45
45
46
+
j.l.Info("adding did to in-memory filter", "did", did)
46
47
j.mu.Lock()
47
48
j.wantedDids[did] = struct{}{}
48
49
j.mu.Unlock()
···
51
52
type processor func(context.Context, *models.Event) error
52
53
53
54
func (j *JetstreamClient) withDidFilter(processFunc processor) processor {
55
+
// empty filter => all dids allowed
56
+
if len(j.wantedDids) == 0 {
57
+
return processFunc
58
+
}
54
59
// since this closure references j.WantedDids; it should auto-update
55
60
// existing instances of the closure when j.WantedDids is mutated
56
61
return func(ctx context.Context, evt *models.Event) error {