From 9333f707fa4b1e0f811bccf341cc695fed942a7f Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Fri, 10 Apr 2020 12:11:06 +0200 Subject: [PATCH 1/3] init: use Create method for rclone backend This properly issues the initial repository creation command Fixes #1896 --- cmd/restic/global.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/restic/global.go b/cmd/restic/global.go index 7b917d5aa..54668d7af 100644 --- a/cmd/restic/global.go +++ b/cmd/restic/global.go @@ -742,7 +742,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) From 60a5c35de9c1d76bb73b4604fc03d85d6c4cea74 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Fri, 10 Apr 2020 12:13:12 +0200 Subject: [PATCH 2/3] rclone: close connection to rclone if open fails --- internal/backend/rclone/backend.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/backend/rclone/backend.go b/internal/backend/rclone/backend.go index c87a2f1b0..2e9887bc4 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 } From 8c36317b7173d7bf9c43ce52b32c3556f114a377 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sat, 19 Sep 2020 19:11:28 +0200 Subject: [PATCH 3/3] rclone: use configured number of connections during create --- internal/backend/rclone/backend.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/backend/rclone/backend.go b/internal/backend/rclone/backend.go index 2e9887bc4..e18d8a998 100644 --- a/internal/backend/rclone/backend.go +++ b/internal/backend/rclone/backend.go @@ -290,7 +290,7 @@ func Create(cfg Config) (*Backend, error) { } restConfig := rest.Config{ - Connections: 20, + Connections: cfg.Connections, URL: url, }