+4
appview/state/state.go
+4
appview/state/state.go
+7
-2
jetstream/jetstream.go
+7
-2
jetstream/jetstream.go
···
29
ident string
30
l *slog.Logger
31
32
wantedDids Set[string]
33
db DB
34
waitForDid bool
···
43
return
44
}
45
46
-
j.l.Info("adding did to in-memory filter", "did", did)
47
j.mu.Lock()
48
j.wantedDids[did] = struct{}{}
49
j.mu.Unlock()
···
67
}
68
}
69
70
-
func NewJetstreamClient(endpoint, ident string, collections []string, cfg *client.ClientConfig, logger *slog.Logger, db DB, waitForDid bool) (*JetstreamClient, error) {
71
if cfg == nil {
72
cfg = client.DefaultClientConfig()
73
cfg.WebsocketURL = endpoint
···
80
db: db,
81
l: logger,
82
wantedDids: make(map[string]struct{}),
83
84
// This will make the goroutine in StartJetstream wait until
85
// j.wantedDids has been populated, typically using addDids.
···
29
ident string
30
l *slog.Logger
31
32
+
logDids bool
33
wantedDids Set[string]
34
db DB
35
waitForDid bool
···
44
return
45
}
46
47
+
if j.logDids {
48
+
j.l.Info("adding did to in-memory filter", "did", did)
49
+
}
50
j.mu.Lock()
51
j.wantedDids[did] = struct{}{}
52
j.mu.Unlock()
···
70
}
71
}
72
73
+
func NewJetstreamClient(endpoint, ident string, collections []string, cfg *client.ClientConfig, logger *slog.Logger, db DB, waitForDid, logDids bool) (*JetstreamClient, error) {
74
if cfg == nil {
75
cfg = client.DefaultClientConfig()
76
cfg.WebsocketURL = endpoint
···
83
db: db,
84
l: logger,
85
wantedDids: make(map[string]struct{}),
86
+
87
+
logDids: logDids,
88
89
// This will make the goroutine in StartJetstream wait until
90
// j.wantedDids has been populated, typically using addDids.
+1
knotserver/config/config.go
+1
knotserver/config/config.go
···
19
DBPath string `env:"DB_PATH, default=knotserver.db"`
20
Hostname string `env:"HOSTNAME, required"`
21
JetstreamEndpoint string `env:"JETSTREAM_ENDPOINT, default=wss://jetstream1.us-west.bsky.network/subscribe"`
22
23
// This disables signature verification so use with caution.
24
Dev bool `env:"DEV, default=false"`
···
19
DBPath string `env:"DB_PATH, default=knotserver.db"`
20
Hostname string `env:"HOSTNAME, required"`
21
JetstreamEndpoint string `env:"JETSTREAM_ENDPOINT, default=wss://jetstream1.us-west.bsky.network/subscribe"`
22
+
LogDids bool `env:"LOG_DIDS, default=true"`
23
24
// This disables signature verification so use with caution.
25
Dev bool `env:"DEV, default=false"`
+1
-1
knotserver/server.go
+1
-1
knotserver/server.go