Fix: do hard-copy when editing file with soft links

This commit is contained in:
HFO4
2020-01-16 10:11:16 +08:00
parent 098aa0a0c0
commit 0e62665d7f
6 changed files with 88 additions and 1 deletions

View File

@@ -177,6 +177,16 @@ func HookGiveBackCapacity(ctx context.Context, fs *FileSystem) error {
return nil
}
// HookUpdateSourceName 更新文件SourceName
// TODO测试
func HookUpdateSourceName(ctx context.Context, fs *FileSystem) error {
originFile, ok := ctx.Value(fsctx.FileModelCtx).(model.File)
if !ok {
return ErrObjectNotExist
}
return originFile.UpdateSourceName(originFile.SourceName)
}
// GenericAfterUpdate 文件内容更新后
func GenericAfterUpdate(ctx context.Context, fs *FileSystem) error {
// 更新文件尺寸