an app.bsky.* indexer

Compare changes

Choose any two refs to compare.

Changed files
+5 -6
cmd
+1 -1
cmd/monarch/backfill.go
···
ParallelBackfills: cctx.Int("backfill-workers"),
ParallelRecordCreates: cctx.Int("backfill-consumers"),
NSIDFilter: "",
-
SyncRequestsPerSecond: 10,
+
SyncRequestsPerSecond: cctx.Int("sync-requests-limit"),
RelayHost: "https://" + cctx.String("relay-host"),
}
+1 -4
cmd/monarch/cursors.go
···
import (
"context"
"log/slog"
-
"sync"
"time"
"gorm.io/gorm"
)
type CursorService struct {
-
store *gorm.DB
-
-
firehoseLk sync.Mutex
+
store *gorm.DB
firehoseSeq int64
}
+3 -1
cmd/monarch/firehose.go
···
func NewFirehoseConnection(ctx context.Context, cctx *cli.Context, cursorSvc *CursorService) (*websocket.Conn, error) {
url := fmt.Sprintf("wss://%s/xrpc/com.atproto.sync.subscribeRepos", cctx.String("relay-host"))
curs, err := cursorSvc.GetFirehoseCursor()
-
if err == nil { // reversed
+
if err != nil {
+
slog.Error("error getting firehose cursor", "err", err)
+
} else if curs > 0 {
url += fmt.Sprintf("?cursor=%d", curs)
}