Merge pull request #2932 from MichaelEischer/proper-rclone-create

Call rclone.Create to create a new repository for the rclone backend
This commit is contained in:
Alexander Neumann 2020-10-09 21:29:15 +02:00 committed by GitHub
commit 30cb553c8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -770,7 +770,7 @@ func create(s string, opts options.Options) (restic.Backend, error) {
case "rest": case "rest":
return rest.Create(cfg.(rest.Config), rt) return rest.Create(cfg.(rest.Config), rt)
case "rclone": case "rclone":
return rclone.Open(cfg.(rclone.Config), nil) return rclone.Create(cfg.(rclone.Config))
} }
debug.Log("invalid repository scheme: %v", s) debug.Log("invalid repository scheme: %v", s)

View file

@ -267,6 +267,7 @@ func Open(cfg Config, lim limiter.Limiter) (*Backend, error) {
restBackend, err := rest.Open(restConfig, debug.RoundTripper(be.tr)) restBackend, err := rest.Open(restConfig, debug.RoundTripper(be.tr))
if err != nil { if err != nil {
_ = be.Close()
return nil, err return nil, err
} }
@ -289,7 +290,7 @@ func Create(cfg Config) (*Backend, error) {
} }
restConfig := rest.Config{ restConfig := rest.Config{
Connections: 20, Connections: cfg.Connections,
URL: url, URL: url,
} }