chore: add refresh arg in list func

This commit is contained in:
Noah Hsu
2022-08-29 19:15:52 +08:00
parent 97d4114e38
commit 68a125491b
4 changed files with 11 additions and 5 deletions

View File

@ -13,7 +13,7 @@ import (
)
// List files
func list(ctx context.Context, path string) ([]model.Obj, error) {
func list(ctx context.Context, path string, refresh ...bool) ([]model.Obj, error) {
meta := ctx.Value("meta").(*model.Meta)
user := ctx.Value("user").(*model.User)
storage, actualPath, err := operations.GetStorageAndActualPath(path)
@ -26,7 +26,7 @@ func list(ctx context.Context, path string) ([]model.Obj, error) {
}
objs, err := operations.List(ctx, storage, actualPath, model.ListArgs{
ReqPath: path,
})
}, refresh...)
if err != nil {
log.Errorf("%+v", err)
if len(virtualFiles) != 0 {