mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
fs/cache: add PutErr to add an fs.Fs with an fs.ErrorIsFile error to the cache
This commit is contained in:
11
fs/cache/cache.go
vendored
11
fs/cache/cache.go
vendored
@@ -168,14 +168,19 @@ func GetArr(ctx context.Context, fsStrings []string) (f []fs.Fs, err error) {
|
||||
return fArr, nil
|
||||
}
|
||||
|
||||
// Put puts an fs.Fs named fsString into the cache
|
||||
func Put(fsString string, f fs.Fs) {
|
||||
// PutErr puts an fs.Fs named fsString into the cache with err
|
||||
func PutErr(fsString string, f fs.Fs, err error) {
|
||||
createOnFirstUse()
|
||||
canonicalName := fs.ConfigString(f)
|
||||
c.Put(canonicalName, f)
|
||||
c.PutErr(canonicalName, f, err)
|
||||
addMapping(fsString, canonicalName)
|
||||
}
|
||||
|
||||
// Put puts an fs.Fs named fsString into the cache
|
||||
func Put(fsString string, f fs.Fs) {
|
||||
PutErr(fsString, f, nil)
|
||||
}
|
||||
|
||||
// ClearConfig deletes all entries which were based on the config name passed in
|
||||
//
|
||||
// Returns number of entries deleted
|
||||
|
||||
Reference in New Issue
Block a user