From a3f0872a7684bd5942b2b20240c16cd7f4326087 Mon Sep 17 00:00:00 2001 From: fuxiaohei Date: Wed, 20 Dec 2023 23:16:51 +0800 Subject: [PATCH] update filepath to handle file's path from storage --- routers/api/actions/artifacts_chunks.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/routers/api/actions/artifacts_chunks.go b/routers/api/actions/artifacts_chunks.go index 60e08a304b626..bce7c4d3092ee 100644 --- a/routers/api/actions/artifacts_chunks.go +++ b/routers/api/actions/artifacts_chunks.go @@ -8,7 +8,6 @@ import ( "encoding/base64" "fmt" "io" - "path" "path/filepath" "sort" "time" @@ -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) }