This website works better with JavaScript.
Home
Issues
Pull Requests
Milestones
AI流水线
Repositories
Datasets
Forum
实训
竞赛
大数据
AI开发
Register
Sign In
JointCloud
/
JCS-pub
Not watched
Unwatch
Watch all
Watch but not notify
1
Star
0
Fork
0
Code
Releases
0
Wiki
evaluate
Activity
Issues
0
Pull Requests
0
Datasets
Model
Cloudbrain
HPC
Browse Source
解决上传的临时文件不会被删除的bug
gitlink
Sydonian
1 year ago
parent
4a60b624ed
commit
5f5a348435
3 changed files
with
4 additions
and
2 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+1
-0
agent/internal/task/cache_move_package.go
+2
-0
common/pkgs/storage/local/shard_store.go
+1
-2
common/pkgs/storage/types/shard_store.go
+ 1
- 0
agent/internal/task/cache_move_package.go
View File
@@ -77,6 +77,7 @@ func (t *CacheMovePackage) do(ctx TaskContext) error {
writer := store.New()
_, err = io.Copy(writer, obj.File)
if err != nil {
writer.Abort()
return fmt.Errorf("writing to store: %w", err)
}
_, err = writer.Finish()
+ 2
- 0
common/pkgs/storage/local/shard_store.go
View File
@@ -226,6 +226,8 @@ func (s *ShardStore) onWritterFinish(w *ShardWriter, hash cdssdk.FileHash) (type
s.removeTempFile(w.path)
log.Warnf("get file %v stat: %v", newPath, err)
return types.FileInfo{}, fmt.Errorf("get file stat: %w", err)
} else {
s.removeTempFile(w.path)
}
return types.FileInfo{
+ 1
- 2
common/pkgs/storage/types/shard_store.go
View File
@@ -65,8 +65,7 @@ type Stats struct {
type ShardWriter interface {
io.Writer
// 取消写入。要求允许在调用了Finish之后再调用此函数,且此时不应该有任何影响。
// 方便defer机制
// 取消写入。要求允许在调用了Finish之后再调用此函数,且此时不应该有任何影响,方便使用defer语句
Abort() error
// 结束写入,获得文件哈希值
Finish() (FileInfo, error)
Write
Preview
Loading…
Cancel
Save