chore: use wg.Go instead of add

This commit is contained in:
Florian Schade
2026-04-22 14:50:57 +02:00
committed by Ralf Haferkamp
parent a8fff7e4c3
commit 86d79430a3
7 changed files with 18 additions and 36 deletions
+2 -4
View File
@@ -146,9 +146,7 @@ func AutoAcceptShares(ev events.ShareCreated, autoAcceptDefault bool, l log.Logg
wg := sync.WaitGroup{}
for i := 0; i < maxConcurrency; i++ {
wg.Add(1)
go func() {
defer wg.Done()
wg.Go(func() {
for userID := range work {
if !autoAcceptShares(ctx, userID, autoAcceptDefault, vs) {
@@ -179,7 +177,7 @@ func AutoAcceptShares(ev events.ShareCreated, autoAcceptDefault bool, l log.Logg
}().Interface("status", resp.GetStatus()).Str("userid", userID.GetOpaqueId()).Msg("unexpected status code while accepting share")
}
}
}()
})
}
// Wait for all goroutines to finish