diff --git a/cmd/restic/global.go b/cmd/restic/global.go index 76deb973b..bf2efde70 100644 --- a/cmd/restic/global.go +++ b/cmd/restic/global.go @@ -770,7 +770,7 @@ func create(s string, opts options.Options) (restic.Backend, error) { case "rest": return rest.Create(cfg.(rest.Config), rt) case "rclone": - return rclone.Open(cfg.(rclone.Config), nil) + return rclone.Create(cfg.(rclone.Config)) } debug.Log("invalid repository scheme: %v", s) diff --git a/internal/backend/rclone/backend.go b/internal/backend/rclone/backend.go index c87a2f1b0..e18d8a998 100644 --- a/internal/backend/rclone/backend.go +++ b/internal/backend/rclone/backend.go @@ -267,6 +267,7 @@ func Open(cfg Config, lim limiter.Limiter) (*Backend, error) { restBackend, err := rest.Open(restConfig, debug.RoundTripper(be.tr)) if err != nil { + _ = be.Close() return nil, err } @@ -289,7 +290,7 @@ func Create(cfg Config) (*Backend, error) { } restConfig := rest.Config{ - Connections: 20, + Connections: cfg.Connections, URL: url, }