Skip to content

Commit

Permalink
Fix fix storage lisring to be aling with virtual index (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
reshke authored Nov 11, 2024
1 parent ddcbe32 commit 81fa571
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/proc/delete_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (dh *BasicDeleteHandler) ListGarbageFiles(msg message.DeleteMessage) ([]str
}

//list files in storage
ylogger.Zero.Info().Str("path", msg.Name).Msg("going to list path")
ylogger.Zero.Info().Str("path", msg.Name).Msg("listing prefix")
objectMetas, err := dh.StorageInterractor.ListPath(msg.Name)
if err != nil {
return nil, errors.Wrap(err, "could not list objects")
Expand Down
10 changes: 9 additions & 1 deletion pkg/storage/s3storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,16 @@ func (s *S3StorageInteractor) ListPath(prefix string) ([]*object.ObjectInfo, err
}

for _, obj := range out.Contents {
path := *obj.Key

ylogger.Zero.Debug().Str("path", path).Msg("listing file")

cPath, ok := strings.CutPrefix(path, s.cnf.StoragePrefix)
if !ok {
continue
}
metas = append(metas, &object.ObjectInfo{
Path: *obj.Key,
Path: "/" + cPath,
Size: *obj.Size,
})
}
Expand Down

0 comments on commit 81fa571

Please sign in to comment.