Skip to content

Commit

Permalink
update filepath to handle file's path from storage
Browse files Browse the repository at this point in the history
  • Loading branch information
fuxiaohei committed Dec 20, 2023
1 parent b70a3cc commit a3f0872
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions routers/api/actions/artifacts_chunks.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"encoding/base64"
"fmt"
"io"
"path"
"path/filepath"
"sort"
"time"
Expand Down Expand Up @@ -74,7 +73,7 @@ func listChunksByRunID(st storage.ObjectStorage, runID int64) (map[int64][]*chun
baseName := filepath.Base(fpath)
// when read chunks from storage, it only contains storage dir and basename,
// no matter the subdirectory setting in storage config
item := chunkFileItem{Path: path.Join(storageDir, baseName)}
item := chunkFileItem{Path: filepath.Join(storageDir, baseName)}
if _, err := fmt.Sscanf(baseName, "%d-%d-%d-%d.chunk", &item.RunID, &item.ArtifactID, &item.Start, &item.End); err != nil {
return fmt.Errorf("parse content range error: %v", err)
}
Expand Down

0 comments on commit a3f0872

Please sign in to comment.