重构: App拆分10域文件+并发安全+结构化日志+依赖升级
This commit is contained in:
@@ -617,13 +617,18 @@ func (s *Service) RenamePath(connID string, oldPath string, newPath string) (*fi
|
||||
if err := c.Copy(ctx, f.Key, newPrefix+relativeKey); err != nil {
|
||||
return nil, fmt.Errorf("复制失败: %w", err)
|
||||
}
|
||||
c.Delete(ctx, f.Key)
|
||||
if err := c.Delete(ctx, f.Key); err != nil {
|
||||
return nil, fmt.Errorf("删除源文件失败: %w", err)
|
||||
}
|
||||
}
|
||||
if !listResult.IsTruncated {
|
||||
break
|
||||
}
|
||||
}
|
||||
c.Delete(ctx, oldKey) // marker
|
||||
if err := c.Delete(ctx, oldKey); err != nil { // marker
|
||||
// 目录标记删除失败不影响重命名结果
|
||||
_ = err
|
||||
}
|
||||
} else {
|
||||
if err := c.Copy(ctx, oldKey, newKey); err != nil {
|
||||
return nil, fmt.Errorf("复制失败: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user