Skip to content

Commit 0be882a

Browse files
committed
fix: Adapt to changes in gix-utils
`Exponential` was renamed to `Quadratic` in `gix_utils::backoff`. This updates the use (and comment) in `gix-lock` accordingly.
1 parent d737c4a commit 0be882a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: gix-lock/src/acquire.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub enum Fail {
1414
/// Fail after the first unsuccessful attempt of obtaining a lock.
1515
#[default]
1616
Immediately,
17-
/// Retry after failure with exponentially longer sleep times to block the current thread.
17+
/// Retry after failure with quadratically longer sleep times to block the current thread.
1818
/// Fail once the given duration is exceeded, similar to [Fail::Immediately]
1919
AfterDurationWithBackoff(Duration),
2020
}
@@ -176,7 +176,7 @@ fn lock_with_mode<T>(
176176
match mode {
177177
Fail::Immediately => try_lock(&lock_path, directory, cleanup),
178178
Fail::AfterDurationWithBackoff(time) => {
179-
for wait in backoff::Exponential::default_with_random().until_no_remaining(time) {
179+
for wait in backoff::Quadratic::default_with_random().until_no_remaining(time) {
180180
attempts += 1;
181181
match try_lock(&lock_path, directory, cleanup.clone()) {
182182
Ok(v) => return Ok((lock_path, v)),

0 commit comments

Comments
 (0)