Skip to content

Commit 07cff5b

Browse files
docs: ACI-5269 name the cooldown parameter so the doc reads as a sentence
"whether every has passed" leaned on the parameter name and read as a dropped word. It is interval now. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 8262e88 commit 07cff5b

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

internal/bazelcredhelper/cooldown.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ import (
88
"github.com/gofrs/flock"
99
)
1010

11-
// claimCooldown reports whether every has passed since the last claim, re-stamping
12-
// the marker when it returns true. The marker's mtime is the state; nothing is
13-
// removed. A failure to stamp reads as "not claimed", so a broken marker stays
14-
// quiet rather than spamming.
11+
// claimCooldown reports whether at least interval has passed since the last claim,
12+
// re-stamping the marker when it has. The marker's mtime is the state; nothing is
13+
// removed. A failure to stamp reads as "not claimed", so a broken marker stays quiet
14+
// rather than spamming.
1515
//
1616
// The lock is what makes it a rate limiter rather than a suggestion: read-then-stamp
1717
// is not atomic, and every helper of a build starts in the same instant, so without
18-
// it they all claim the same window.
19-
func claimCooldown(path string, every time.Duration) bool {
18+
// it they would all claim the same window.
19+
func claimCooldown(path string, interval time.Duration) bool {
2020
if err := os.MkdirAll(filepath.Dir(path), 0o700); err != nil {
2121
return false
2222
}
@@ -29,7 +29,7 @@ func claimCooldown(path string, every time.Duration) bool {
2929
defer func() { _ = lock.Unlock() }()
3030

3131
if info, err := os.Stat(path); err == nil {
32-
if time.Since(info.ModTime()) < every {
32+
if time.Since(info.ModTime()) < interval {
3333
return false
3434
}
3535
now := time.Now()

0 commit comments

Comments
 (0)