mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-09-24 11:14:14 +00:00
fix bluesky profile not emitting firehose event
This commit is contained in:
+20
-15
@@ -123,7 +123,26 @@ func NewHoldServer(cfg *Config) (*HoldServer, error) {
|
||||
return nil, fmt.Errorf("failed to create S3 service: %w", err)
|
||||
}
|
||||
|
||||
// Bootstrap PDS with captain record, hold owner as first crew member, and profile
|
||||
// Bootstrap events from existing repo records (one-time migration).
|
||||
// Must run BEFORE the live event handler is wired, so it captures
|
||||
// the full historical state without interference from new writes.
|
||||
if err := s.broadcaster.BootstrapFromRepo(s.PDS); err != nil {
|
||||
slog.Warn("Failed to bootstrap events from repo", "error", err)
|
||||
}
|
||||
|
||||
// Backfill records index from existing MST data (one-time on startup)
|
||||
if err := s.PDS.BackfillRecordsIndex(ctx); err != nil {
|
||||
slog.Warn("Failed to backfill records index", "error", err)
|
||||
}
|
||||
|
||||
// Wire up repo event handler with records indexing + broadcaster.
|
||||
// Must be BEFORE Bootstrap so that record creates/updates during
|
||||
// bootstrap (captain, crew, profile) emit to the firehose.
|
||||
indexingHandler := s.PDS.CreateRecordsIndexEventHandler(s.broadcaster.SetRepoEventHandler())
|
||||
s.PDS.RepomgrRef().SetEventHandler(indexingHandler, true)
|
||||
|
||||
// Bootstrap PDS with captain record, hold owner as first crew member, and profile.
|
||||
// Now that the event handler is wired, any changes here emit to the firehose.
|
||||
if err := s.PDS.Bootstrap(ctx, s3Service, pds.BootstrapConfig{
|
||||
OwnerDID: cfg.Registration.OwnerDID,
|
||||
Public: cfg.Server.Public,
|
||||
@@ -148,20 +167,6 @@ func NewHoldServer(cfg *Config) (*HoldServer, error) {
|
||||
}
|
||||
}
|
||||
|
||||
// Bootstrap events from existing repo records (one-time migration)
|
||||
if err := s.broadcaster.BootstrapFromRepo(s.PDS); err != nil {
|
||||
slog.Warn("Failed to bootstrap events from repo", "error", err)
|
||||
}
|
||||
|
||||
// Backfill records index from existing MST data (one-time on startup)
|
||||
if err := s.PDS.BackfillRecordsIndex(ctx); err != nil {
|
||||
slog.Warn("Failed to backfill records index", "error", err)
|
||||
}
|
||||
|
||||
// Wire up repo event handler with records indexing + broadcaster
|
||||
indexingHandler := s.PDS.CreateRecordsIndexEventHandler(s.broadcaster.SetRepoEventHandler())
|
||||
s.PDS.RepomgrRef().SetEventHandler(indexingHandler, true)
|
||||
|
||||
slog.Info("Embedded PDS initialized successfully with firehose and records index enabled")
|
||||
} else {
|
||||
return nil, fmt.Errorf("database path is required for embedded PDS authorization")
|
||||
|
||||
Reference in New Issue
Block a user