Skip to content

Commit

Permalink
gc: remove wonky timeout
Browse files Browse the repository at this point in the history
This timeout was:
- unneccessary
- based on a metric that doesn't make sense

License: MIT
Signed-off-by: Lars Gierth <[email protected]>
  • Loading branch information
Lars Gierth committed Dec 9, 2016
1 parent 2aded67 commit a9b8c8b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions core/corerepo/gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,8 @@ func (gc *GC) maybeGC(ctx context.Context, offset uint64) error {
// Do GC here
log.Info("Watermark exceeded. Starting repo GC...")
defer log.EventBegin(ctx, "repoGC").Done()
// 1 minute is sufficient for ~1GB unlink() blocks each of 100kb in SSD
_ctx, cancel := context.WithTimeout(ctx, time.Duration(gc.SlackGB)*time.Minute)
defer cancel()

if err := GarbageCollect(gc.Node, _ctx); err != nil {
if err := GarbageCollect(gc.Node, ctx); err != nil {
return err
}
newStorage, err := gc.Repo.GetStorageUsage()
Expand Down

0 comments on commit a9b8c8b

Please sign in to comment.