Skip to content

Commit

Permalink
Add more checks for backfill enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Jan 25, 2024
1 parent 70b9fc0 commit e76f500
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backfill.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ func (user *User) handleBackfillTask(ctx context.Context, task *database.Backfil
}

func (user *User) BackfillLoop() {
if !user.bridge.Config.Bridge.Backfill.Enabled {
return
}
log := user.log.With().Str("action", "backfill loop").Logger()
defer func() {
log.Debug().Msg("Backfill loop stopped")
Expand Down
3 changes: 3 additions & 0 deletions user.go
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,9 @@ func (user *User) handleTable(tbl *table.LSTable) {
}

func (user *User) requestMoreInbox(ctx context.Context, itrs []*table.LSUpsertInboxThreadsRange) {
if !user.bridge.Config.Bridge.Backfill.Enabled {
return
}
maxInboxPages := user.bridge.Config.Bridge.Backfill.InboxFetchPages
if len(itrs) == 0 || user.InboxFetched || maxInboxPages == 0 {
return
Expand Down

0 comments on commit e76f500

Please sign in to comment.