Skip to content

Commit 9b02689

Browse files
committed
rename function GetFirstUnuploadedBatchByPlatform
1 parent dabcfca commit 9b02689

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

rollup/internal/controller/blob_uploader/blob_uploader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ func (b *BlobUploader) constructBlobCodec(dbBatch *orm.Batch) (*kzg4844.Blob, er
200200
// GetFirstUnuploadedBatchByPlatform retrieves the first batch that either hasn't been uploaded to corresponding blob storage service
201201
// The batch must have a commit_tx_hash (committed).
202202
func (b *BlobUploader) GetFirstUnuploadedBatchByPlatform(ctx context.Context, startBatch uint64, platform types.BlobStoragePlatform) (*orm.Batch, error) {
203-
batchIndex, err := b.blobUploadOrm.GetFirstUnuploadedBatchIndexByPlatform(ctx, startBatch, platform)
203+
batchIndex, err := b.blobUploadOrm.GetNextBatchIndexToUploadByPlatform(ctx, startBatch, platform)
204204
if err != nil {
205205
return nil, err
206206
}

rollup/internal/orm/blob_upload.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ func (*BlobUpload) TableName() string {
3737
return "blob_upload"
3838
}
3939

40-
// GetFirstUnuploadedBatchIndexByPlatform retrieves the first batch index that hasn't been uploaded to corresponding blob storage service
41-
func (o *BlobUpload) GetFirstUnuploadedBatchIndexByPlatform(ctx context.Context, startBatch uint64, platform types.BlobStoragePlatform) (uint64, error) {
40+
// GetNextBatchIndexToUploadByPlatform retrieves the next batch index that hasn't been uploaded to corresponding blob storage service
41+
func (o *BlobUpload) GetNextBatchIndexToUploadByPlatform(ctx context.Context, startBatch uint64, platform types.BlobStoragePlatform) (uint64, error) {
4242
db := o.db.WithContext(ctx)
4343
db = db.Model(&BlobUpload{})
4444
db = db.Where("platform = ? AND status = ? AND deleted_at IS NULL", platform, types.BlobUploadStatusUploaded)
@@ -51,7 +51,7 @@ func (o *BlobUpload) GetFirstUnuploadedBatchIndexByPlatform(ctx context.Context,
5151
if errors.Is(err, gorm.ErrRecordNotFound) {
5252
batchIndex = startBatch
5353
} else {
54-
return 0, fmt.Errorf("BlobUpload.GetFirstUnuploadedBatchIndexByPlatform error: %w", err)
54+
return 0, fmt.Errorf("BlobUpload.GetNextBatchIndexToUploadByPlatform error: %w", err)
5555
}
5656
} else {
5757
batchIndex = blobUpload.BatchIndex + 1

0 commit comments

Comments
 (0)