Add Restic read concurrency setting
This commit is contained in:
@@ -92,6 +92,18 @@ func TestBackupCPUCoresRange(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestBackupReadConcurrencyRange(t *testing.T) {
|
||||
job := Job{SchemaVersion: 1, ID: "job", Name: "Share", Type: JobShare, RepositoryID: "repo", Sources: []Source{{Path: "/mnt/user/data"}}, Consistency: Consistency{Mode: "live"}, Compression: "auto", Retention: Retention{KeepWithinDays: 30}}
|
||||
job.ReadConcurrency = 8
|
||||
if err := ValidateJob(job); err != nil {
|
||||
t.Fatalf("valid read concurrency rejected: %v", err)
|
||||
}
|
||||
job.ReadConcurrency = 65
|
||||
if err := ValidateJob(job); err == nil {
|
||||
t.Fatal("excessive read concurrency accepted")
|
||||
}
|
||||
}
|
||||
|
||||
func TestRsyncJobDoesNotRequireRepository(t *testing.T) {
|
||||
c := DefaultConfig()
|
||||
c.Jobs = []Job{{SchemaVersion: 1, ID: "rsync-job", Name: "Mirror", Type: JobRsync, Enabled: true, Sources: []Source{{Path: "/mnt/user/data"}}, Rsync: RsyncOptions{Target: "/mnt/remotes/backup", Overwrite: true}}}
|
||||
|
||||
Reference in New Issue
Block a user