Skip to content

Commit

Permalink
feat: return when no object in primary/secondary case
Browse files Browse the repository at this point in the history
feat: add debug log

fix: wording
  • Loading branch information
annielz committed Nov 22, 2024
1 parent b41d2a4 commit de551f0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions store/piecestore/storage/oss.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ func (o *ossStore) DeleteObjectsByPrefix(ctx context.Context, key string) (uint6
return size, err
}

if len(objs) == 0 {
log.CtxDebugw(ctx, "No object listed in oss by prefix", "prefix", key)
return 0, nil
}

// if the object listed here is less than required batch size, meaning it is the last page
if int64(len(objs)) < batchSize {
continueDeleteObject = false
Expand Down
5 changes: 5 additions & 0 deletions store/piecestore/storage/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ func (s *s3Store) DeleteObjectsByPrefix(ctx context.Context, key string) (uint64
return size, err
}

if len(objs) == 0 {
log.CtxDebugw(ctx, "No object listed in s3 by prefix", "prefix", key)
return 0, nil
}

if int64(len(objs)) < batchSize {
continueDeleteObject = false
}
Expand Down

0 comments on commit de551f0

Please sign in to comment.