feat: clear cache after change

This commit is contained in:
Noah Hsu
2022-06-30 22:51:49 +08:00
parent 2b1726614b
commit 53416172e7
5 changed files with 31 additions and 3 deletions

View File

@ -31,6 +31,8 @@ func moveFiles(ctx context.Context, src, dst string, overwrite bool) (status int
if err != nil {
return http.StatusInternalServerError, err
}
fs.ClearCache(path.Dir(src))
fs.ClearCache(path.Dir(dst))
// TODO if there are no files copy, should return 204
return http.StatusCreated, nil
}
@ -43,6 +45,7 @@ func copyFiles(ctx context.Context, src, dst string, overwrite bool) (status int
if err != nil {
return http.StatusInternalServerError, err
}
fs.ClearCache(path.Dir(dst))
// TODO if there are no files copy, should return 204
return http.StatusCreated, nil
}