mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-04-23 03:00:50 -04:00
fix: recover should be added if chunk do updated
This commit is contained in:
@@ -163,17 +163,17 @@ func (bp *BatchProverTask) Assign(ctx *gin.Context, getTaskParameter *coordinato
|
||||
log.Error("failed to update batch attempts", "height", getTaskParameter.ProverHeight, "err", updateAttemptsErr)
|
||||
return nil, ErrCoordinatorInternalFailure
|
||||
}
|
||||
if rowsAffected == 0 {
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
continue
|
||||
}
|
||||
|
||||
defer func(batchTask *orm.Batch) {
|
||||
if retErr != nil {
|
||||
bp.recoverActiveAttempts(ctx, batchTask)
|
||||
log.Debug("recover active attempts", "batch task_id", batchTask.Hash)
|
||||
}
|
||||
}(tmpBatchTask)
|
||||
|
||||
if rowsAffected == 0 {
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
batchTask = tmpBatchTask
|
||||
|
||||
@@ -161,17 +161,16 @@ func (bp *BundleProverTask) Assign(ctx *gin.Context, getTaskParameter *coordinat
|
||||
log.Error("failed to update bundle attempts", "height", getTaskParameter.ProverHeight, "err", updateAttemptsErr)
|
||||
return nil, ErrCoordinatorInternalFailure
|
||||
}
|
||||
if rowsAffected == 0 {
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
continue
|
||||
}
|
||||
defer func(bundleTask *orm.Bundle) {
|
||||
if retErr != nil {
|
||||
bp.recoverActiveAttempts(ctx, bundleTask)
|
||||
log.Debug("recover active attempts", "bundle task_id", bundleTask.Hash)
|
||||
}
|
||||
}(tmpBundleTask)
|
||||
|
||||
if rowsAffected == 0 {
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
continue
|
||||
}
|
||||
}
|
||||
bundleTask = tmpBundleTask
|
||||
break
|
||||
|
||||
@@ -166,6 +166,10 @@ func (cp *ChunkProverTask) Assign(ctx *gin.Context, getTaskParameter *coordinato
|
||||
log.Error("failed to update chunk attempts", "height", getTaskParameter.ProverHeight, "err", updateAttemptsErr)
|
||||
return nil, ErrCoordinatorInternalFailure
|
||||
}
|
||||
if rowsAffected == 0 {
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
continue
|
||||
}
|
||||
defer func(chunkTask *orm.Chunk) {
|
||||
if retErr != nil {
|
||||
cp.recoverActiveAttempts(ctx, chunkTask)
|
||||
@@ -173,10 +177,6 @@ func (cp *ChunkProverTask) Assign(ctx *gin.Context, getTaskParameter *coordinato
|
||||
}
|
||||
}(tmpChunkTask)
|
||||
|
||||
if rowsAffected == 0 {
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
continue
|
||||
}
|
||||
}
|
||||
chunkTask = tmpChunkTask
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user