Skip to content

Commit 6d08239

Browse files
committed
fix: logs
1 parent 8ac3181 commit 6d08239

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

rollup/internal/orm/batch.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,15 +278,23 @@ func (o *Batch) GetFirstUnuploadedBatchByPlatform(ctx context.Context, startBatc
278278
if errors.Is(err, gorm.ErrRecordNotFound) {
279279
batchIndex = startBatch
280280
} else {
281-
return nil, fmt.Errorf("Batch.GetLatestSuccessfulBlobUploadIndex error: %w", err)
281+
return nil, fmt.Errorf("Batch.GetFirstUnuploadedBatchByPlatform error: %w", err)
282282
}
283283
} else {
284284
batchIndex = blobUpload.BatchIndex + 1
285285
}
286286

287287
batch, err := o.GetBatchByIndex(ctx, batchIndex)
288-
if err != nil || len(batch.CommitTxHash) == 0 {
289-
log.Debug("got batch not ready for blob uploading", "batch_index", batchIndex, "platform", platform.String())
288+
if err != nil {
289+
if errors.Is(err, gorm.ErrRecordNotFound) {
290+
log.Debug("got batch not proposed for blob uploading", "batch_index", batchIndex, "platform", platform.String())
291+
return nil, nil
292+
}
293+
return nil, fmt.Errorf("Batch.GetFirstUnuploadedBatchByPlatform error: %w", err)
294+
}
295+
296+
if len(batch.CommitTxHash) == 0 {
297+
log.Debug("got batch not committed for blob uploading", "batch_index", batchIndex, "platform", platform.String())
290298
return nil, nil
291299
}
292300

0 commit comments

Comments
 (0)