From 772dcebf9fa9de7c592c7abce69f274c2e5bdca4 Mon Sep 17 00:00:00 2001 From: georgehao Date: Mon, 1 Apr 2024 17:33:34 +0800 Subject: [PATCH] feat: update --- coordinator/internal/orm/chunk.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/coordinator/internal/orm/chunk.go b/coordinator/internal/orm/chunk.go index bf253ea965..84ff557b99 100644 --- a/coordinator/internal/orm/chunk.go +++ b/coordinator/internal/orm/chunk.go @@ -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 @@ -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