From 8ce51217863c885f9fdd31292122d799c5bdd1f2 Mon Sep 17 00:00:00 2001 From: Morty Date: Mon, 30 Dec 2024 22:06:12 +0800 Subject: [PATCH] fix: GetUnassignedBatchCount --- coordinator/internal/orm/batch.go | 1 + 1 file changed, 1 insertion(+) diff --git a/coordinator/internal/orm/batch.go b/coordinator/internal/orm/batch.go index 147b9f6e9..b3907c9ec 100644 --- a/coordinator/internal/orm/batch.go +++ b/coordinator/internal/orm/batch.go @@ -100,6 +100,7 @@ func (o *Batch) GetUnassignedBatchCount(ctx context.Context, maxActiveAttempts, db = db.Where("proving_status = ?", int(types.ProvingTaskUnassigned)) db = db.Where("total_attempts < ?", maxTotalAttempts) db = db.Where("active_attempts < ?", maxActiveAttempts) + db = db.Where("chunk_proofs_status = ?", int(types.ChunkProofsStatusReady)) db = db.Where("batch.deleted_at IS NULL") if err := db.Count(&count).Error; err != nil { return 0, fmt.Errorf("Batch.GetUnassignedBatchCount error: %w", err)