connector: do not forward backfill empty rooms

We'll quickly hit ratelimits if we have a bunch of empty rooms, since
forward backfilling apparently doesn't go through the queue.
This commit is contained in:
Skip R
2025-11-25 13:48:45 -08:00
parent ae98d58dbe
commit 8c8f029e11

View File

@@ -68,7 +68,8 @@ func (d *DiscordChatResync) ShouldCreatePortal() bool {
func (d *DiscordChatResync) CheckNeedsBackfill(ctx context.Context, latestBridged *database.Message) (bool, error) { func (d *DiscordChatResync) CheckNeedsBackfill(ctx context.Context, latestBridged *database.Message) (bool, error) {
if latestBridged == nil { if latestBridged == nil {
return true, nil zerolog.Ctx(ctx).Debug().Str("channel_id", d.channel.ID).Msg("Haven't bridged any messages at all, not forward backfilling")
return false, nil
} }
return latestBridged.ID < networkid.MessageID(d.channel.LastMessageID), nil return latestBridged.ID < networkid.MessageID(d.channel.LastMessageID), nil
} }