Add Restic read concurrency setting

This commit is contained in:
Mikei386
2026-06-15 20:49:51 +02:00
parent bb6b3211e9
commit 84df215ad0
12 changed files with 79 additions and 28 deletions
+12
View File
@@ -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}}}