Skip to content

Commit

Permalink
Mark finished backfills as complete in the backfill jobstore (#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericvolp12 authored Sep 22, 2023
2 parents 3eba817 + 2bee518 commit b6a6ed5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions backfill/backfill.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,12 @@ func (b *Backfiller) FlushBuffer(ctx context.Context, job Job) int {
log.Error("failed to flush buffered ops", "error", err)
}

// Mark the job as "complete"
err = job.SetState(ctx, StateComplete)
if err != nil {
log.Error("failed to set job state", "error", err)
}

return processed
}

Expand Down
1 change: 1 addition & 0 deletions search/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func NewServer(db *gorm.DB, escli *es.Client, dir identity.Directory, config Con
opts := backfill.DefaultBackfillOptions()
if config.BGSSyncRateLimit > 0 {
opts.SyncRequestsPerSecond = config.BGSSyncRateLimit
opts.ParallelBackfills = 2 * config.BGSSyncRateLimit
} else {
opts.SyncRequestsPerSecond = 8
}
Expand Down

0 comments on commit b6a6ed5

Please sign in to comment.