Skip to content

Commit

Permalink
fix artifact merging chunks path with correct slash
Browse files Browse the repository at this point in the history
  • Loading branch information
fuxiaohei committed Aug 8, 2023
1 parent 4fc4f6e commit 00ac048
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion routers/api/actions/artifacts_chunks.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"encoding/base64"
"fmt"
"io"
"path/filepath"
"sort"
"time"

Expand Down Expand Up @@ -67,7 +68,7 @@ func listChunksByRunID(st storage.ObjectStorage, runID int64) (map[int64][]*chun
var chunks []*chunkFileItem
if err := st.IterateObjects(storageDir, func(path string, obj storage.Object) error {
item := chunkFileItem{Path: path}
if _, err := fmt.Sscanf(path, storageDir+"/%d-%d-%d.chunk", &item.ArtifactID, &item.Start, &item.End); err != nil {
if _, err := fmt.Sscanf(path, filepath.Join(storageDir, "%d-%d-%d.chunk"), &item.ArtifactID, &item.Start, &item.End); err != nil {
return fmt.Errorf("parse content range error: %v", err)
}
chunks = append(chunks, &item)
Expand Down

0 comments on commit 00ac048

Please sign in to comment.