Skip to content

Commit

Permalink
feat: update
Browse files Browse the repository at this point in the history
  • Loading branch information
georgehao committed Apr 1, 2024
1 parent 3afa5fa commit 772dceb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions coordinator/internal/orm/chunk.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ func (o *Chunk) GetUnassignedChunk(ctx context.Context, height int, maxActiveAtt
db := o.db.WithContext(ctx)
db = db.Model(&Chunk{})
db = db.Where("proving_status = ?", int(types.ProvingTaskUnassigned))
db = db.Where("active_attempts = 0")
db = db.Where("total_attempts < ?", maxTotalAttempts)
db = db.Where("active_attempts < ?", maxActiveAttempts)
//db = db.Where("active_attempts < ?", maxActiveAttempts)
db = db.Where("end_block_number <= ?", height)

var chunk Chunk
Expand All @@ -96,8 +97,9 @@ func (o *Chunk) GetAssignedChunk(ctx context.Context, height int, maxActiveAttem
db := o.db.WithContext(ctx)
db = db.Model(&Chunk{})
db = db.Where("proving_status = ?", int(types.ProvingTaskAssigned))
db = db.Where("active_attempts = 0")
db = db.Where("total_attempts < ?", maxTotalAttempts)
db = db.Where("active_attempts < ?", maxActiveAttempts)
//db = db.Where("active_attempts < ?", maxActiveAttempts)
db = db.Where("end_block_number <= ?", height)

var chunk Chunk
Expand Down

0 comments on commit 772dceb

Please sign in to comment.