local: Limit concurrent backend operations

Use a limit of 2 similar to the filereader concurrency in the archiver.
This commit is contained in:
Michael Eischer 2021-08-07 19:50:00 +02:00
parent 0b258cc054
commit cd783358d3
7 changed files with 88 additions and 32 deletions

View file

@ -30,7 +30,8 @@ var parseTests = []struct {
"local:/srv/repo",
Location{Scheme: "local",
Config: local.Config{
Path: "/srv/repo",
Path: "/srv/repo",
Connections: 2,
},
},
},
@ -38,7 +39,8 @@ var parseTests = []struct {
"local:dir1/dir2",
Location{Scheme: "local",
Config: local.Config{
Path: "dir1/dir2",
Path: "dir1/dir2",
Connections: 2,
},
},
},
@ -46,7 +48,8 @@ var parseTests = []struct {
"local:dir1/dir2",
Location{Scheme: "local",
Config: local.Config{
Path: "dir1/dir2",
Path: "dir1/dir2",
Connections: 2,
},
},
},
@ -54,7 +57,8 @@ var parseTests = []struct {
"dir1/dir2",
Location{Scheme: "local",
Config: local.Config{
Path: "dir1/dir2",
Path: "dir1/dir2",
Connections: 2,
},
},
},
@ -62,7 +66,8 @@ var parseTests = []struct {
"/dir1/dir2",
Location{Scheme: "local",
Config: local.Config{
Path: "/dir1/dir2",
Path: "/dir1/dir2",
Connections: 2,
},
},
},
@ -70,7 +75,8 @@ var parseTests = []struct {
"local:../dir1/dir2",
Location{Scheme: "local",
Config: local.Config{
Path: "../dir1/dir2",
Path: "../dir1/dir2",
Connections: 2,
},
},
},
@ -78,7 +84,8 @@ var parseTests = []struct {
"/dir1/dir2",
Location{Scheme: "local",
Config: local.Config{
Path: "/dir1/dir2",
Path: "/dir1/dir2",
Connections: 2,
},
},
},
@ -86,7 +93,8 @@ var parseTests = []struct {
"/dir1:foobar/dir2",
Location{Scheme: "local",
Config: local.Config{
Path: "/dir1:foobar/dir2",
Path: "/dir1:foobar/dir2",
Connections: 2,
},
},
},
@ -94,7 +102,8 @@ var parseTests = []struct {
`\dir1\foobar\dir2`,
Location{Scheme: "local",
Config: local.Config{
Path: `\dir1\foobar\dir2`,
Path: `\dir1\foobar\dir2`,
Connections: 2,
},
},
},
@ -102,7 +111,8 @@ var parseTests = []struct {
`c:\dir1\foobar\dir2`,
Location{Scheme: "local",
Config: local.Config{
Path: `c:\dir1\foobar\dir2`,
Path: `c:\dir1\foobar\dir2`,
Connections: 2,
},
},
},
@ -110,7 +120,8 @@ var parseTests = []struct {
`C:\Users\appveyor\AppData\Local\Temp\1\restic-test-879453535\repo`,
Location{Scheme: "local",
Config: local.Config{
Path: `C:\Users\appveyor\AppData\Local\Temp\1\restic-test-879453535\repo`,
Path: `C:\Users\appveyor\AppData\Local\Temp\1\restic-test-879453535\repo`,
Connections: 2,
},
},
},
@ -118,7 +129,8 @@ var parseTests = []struct {
`c:/dir1/foobar/dir2`,
Location{Scheme: "local",
Config: local.Config{
Path: `c:/dir1/foobar/dir2`,
Path: `c:/dir1/foobar/dir2`,
Connections: 2,
},
},
},