mirror of
https://github.com/keven1024/015.git
synced 2026-05-26 07:08:02 +00:00
fix(backend): improve error handling in GetFileSliceList function to ignore non-existent directory errors
This commit is contained in:
@@ -31,7 +31,7 @@ func CreateFileSlice(fileId string, uploadPath string, fileSlice io.Reader, file
|
||||
func GetFileSliceList(fileId string, uploadPath string) ([]int, error) {
|
||||
slicesPath := filepath.Join(uploadPath, fmt.Sprintf("%s_%s", fileId, "tmp"))
|
||||
files, err := os.ReadDir(slicesPath)
|
||||
if err != nil {
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
return nil, fmt.Errorf("读取切片目录失败: %v", err)
|
||||
}
|
||||
fileSliceList := []int{}
|
||||
|
||||
Reference in New Issue
Block a user