- Be conservative about the number of goroutines
- Minor fixes
- Add Webdav to ui
- Add more configs to UI
This commit is contained in:
Mukhtar Akere
2025-03-28 00:25:02 +01:00
parent 4ae5de99e8
commit f9bc7ad914
14 changed files with 252 additions and 96 deletions

View File

@@ -18,7 +18,7 @@ func (r *Repair) clean(job *Job) error {
mu := sync.Mutex{}
// Limit concurrent goroutines
g.SetLimit(runtime.NumCPU() * 4)
g.SetLimit(10)
for _, a := range job.Arrs {
a := a // Capture range variable

View File

@@ -218,6 +218,8 @@ func (r *Repair) repair(job *Job) error {
// Create a new error group with context
g, ctx := errgroup.WithContext(context.Background())
g.SetLimit(4)
// Use a mutex to protect concurrent access to brokenItems
var mu sync.Mutex
brokenItems := map[string][]arr.ContentFile{}
@@ -397,7 +399,7 @@ func (r *Repair) repairArr(j *Job, _arr string, tmdbId string) ([]arr.ContentFil
g, ctx := errgroup.WithContext(context.Background())
// Limit concurrent goroutines
g.SetLimit(runtime.NumCPU() * 4)
g.SetLimit(10)
// Mutex for brokenItems
var mu sync.Mutex