mirror of
https://github.com/restic/restic.git
synced 2025-08-23 04:07:25 +00:00
Merge pull request #4353 from MichaelEischer/tune-gc
Tune Go garbage collector
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"runtime"
|
||||
"sort"
|
||||
"sync"
|
||||
|
||||
@@ -601,6 +602,9 @@ func (r *Repository) LoadIndex(ctx context.Context) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// Trigger GC to reset garbage collection threshold
|
||||
runtime.GC()
|
||||
|
||||
if r.cfg.Version < 2 {
|
||||
// sanity check
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
|
Reference in New Issue
Block a user