mirror of
https://github.com/AlistGo/alist.git
synced 2025-04-21 20:18:47 +08:00
feat: add NoCache
config for driver
This commit is contained in:
parent
c525406516
commit
6accc2eff6
@ -6,4 +6,5 @@ type Config struct {
|
||||
OnlyLocal bool
|
||||
OnlyProxy bool
|
||||
NoNeedSetLink bool
|
||||
NoCache bool
|
||||
}
|
||||
|
@ -20,6 +20,9 @@ var filesG singleflight.Group[[]driver.FileInfo]
|
||||
|
||||
// List files in storage, not contains virtual file
|
||||
func List(ctx context.Context, account driver.Driver, path string) ([]driver.FileInfo, error) {
|
||||
if account.Config().NoCache {
|
||||
return account.List(ctx, path)
|
||||
}
|
||||
key := stdpath.Join(account.GetAccount().VirtualPath, path)
|
||||
if files, ok := filesCache.Get(key); ok {
|
||||
return files, nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user