an app.bsky.* indexer

Compare changes

Choose any two refs to compare.

Changed files
+22 -2
cmd
+1 -1
cmd/monarch/hosts.go
···
}
func (cs *CursorService) SetHostCursor(host string, cursor string) error {
-
if err := cs.store.Where(hostCursor{
Host: host,
}).Update("cursor", cursor).Error; err != nil {
return err
···
}
func (cs *CursorService) SetHostCursor(host string, cursor string) error {
+
if err := cs.store.Model(&hostCursor{}).Where(hostCursor{
Host: host,
}).Update("cursor", cursor).Error; err != nil {
return err
+20
cmd/monarch/handlers.go
···
"context"
"encoding/json"
"fmt"
appbsky "github.com/bluesky-social/indigo/api/bsky"
"github.com/bluesky-social/indigo/atproto/syntax"
···
var out appbsky.LabelerService
out.UnmarshalCBOR(bytes.NewReader(*rec))
body, err = json.Marshal(out)
}
switch action {
···
"context"
"encoding/json"
"fmt"
+
"log/slog"
appbsky "github.com/bluesky-social/indigo/api/bsky"
"github.com/bluesky-social/indigo/atproto/syntax"
···
var out appbsky.LabelerService
out.UnmarshalCBOR(bytes.NewReader(*rec))
body, err = json.Marshal(out)
+
+
case syntax.NSID("app.bsky.graph.list"):
+
var out appbsky.GraphList
+
out.UnmarshalCBOR(bytes.NewReader(*rec))
+
body, err = json.Marshal(out)
+
+
case syntax.NSID("app.bsky.graph.verification"):
+
var out appbsky.GraphVerification
+
out.UnmarshalCBOR(bytes.NewReader(*rec))
+
body, err = json.Marshal(out)
+
+
case syntax.NSID("app.bsky.graph.starterpack"):
+
var out appbsky.GraphStarterpack
+
out.UnmarshalCBOR(bytes.NewReader(*rec))
+
body, err = json.Marshal(out)
+
+
default:
+
slog.Error("tracked collection missing handler", "collection", uri.Collection())
+
return nil
}
switch action {
+1 -1
cmd/monarch/backfill.go
···
ParallelBackfills: cctx.Int("backfill-workers"),
ParallelRecordCreates: cctx.Int("backfill-consumers"),
NSIDFilter: "",
-
SyncRequestsPerSecond: 10,
RelayHost: "https://" + cctx.String("relay-host"),
}
···
ParallelBackfills: cctx.Int("backfill-workers"),
ParallelRecordCreates: cctx.Int("backfill-consumers"),
NSIDFilter: "",
+
SyncRequestsPerSecond: cctx.Int("sync-requests-limit"),
RelayHost: "https://" + cctx.String("relay-host"),
}