Skip to content

Commit 17db0cd

Browse files
Merge pull request #51128 from thaJeztah/28.x_backport_gcpolicy-invalid-calculations
[28.x backport] builder: use proper percentage calculations for default gc policy
2 parents 0f040aa + dccf7c8 commit 17db0cd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • builder/builder-next/worker

builder/builder-next/worker/gc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,6 @@ func DefaultGCPolicy(p string, reservedSpace, maxUsedSpace, minFreeSpace int64)
7272
}
7373

7474
func diskPercentage(dstat disk.DiskStat, percentage int64) int64 {
75-
avail := dstat.Total / percentage
75+
avail := dstat.Total * percentage / 100
7676
return (avail/(1<<30) + 1) * 1e9 // round up
7777
}

0 commit comments

Comments
 (0)