fs: Add context to fs.Features.Fill & fs.Features.Mask #3257 #4685

This commit is contained in:
Nick Craig-Wood
2020-11-09 18:05:54 +00:00
parent d69b96a94c
commit 8b96933e58
38 changed files with 48 additions and 48 deletions
+2 -2
View File
@@ -266,7 +266,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e
CaseInsensitive: true,
CanHaveEmptyDirectories: true,
ReadMimeType: true,
}).Fill(f)
}).Fill(ctx, f)
f.srv.SetErrorHandler(errorHandler)
// Renew the token in the background
@@ -302,7 +302,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e
}
return nil, err
}
f.features.Fill(&tempF)
f.features.Fill(ctx, &tempF)
// XXX: update the old f here instead of returning tempF, since
// `features` were already filled with functions having *f as a receiver.
// See https://github.com/rclone/rclone/issues/2182