Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb4fd74c

Browse files
committed
Improve description of backoff sequence in db.loose
The sequence of backoff wait times used in `gitdb.db.loose` isquadratic rather than exponential, as discussed in:#115 (comment)This corrects the variable name by making it more general, and thecomment by having it explicitly describe the backoff as quadratic.This is conceptually related toGitoxideLabs/gitoxide#1815, butthis is a non-breaking change, as no interfaces are affected: onlya local variable and comment.
1 parent9e68ea1 commitb4fd74c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎gitdb/db/loose.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,16 +230,16 @@ def store(self, istream):
230230
# end rename only if needed
231231

232232
# Ensure rename is actually done and file is stable
233-
# Retry up to 14 times -exponential wait & retry in ms.
233+
# Retry up to 14 times -quadratic wait & retry in ms.
234234
# The total maximum wait time is 1000ms, which should be vastly enough for the
235235
# OS to return and commit the file to disk.
236-
forexp_backoff_msin [1,4,9,16,25,36,49,64,81,100,121,144,169,181]:
236+
forbackoff_msin [1,4,9,16,25,36,49,64,81,100,121,144,169,181]:
237237
withsuppress(PermissionError):
238238
# make sure its readable for all ! It started out as rw-- tmp file
239239
# but needs to be rwrr
240240
chmod(obj_path,self.new_objects_mode)
241241
break
242-
time.sleep(exp_backoff_ms/1000.0)
242+
time.sleep(backoff_ms/1000.0)
243243
else:
244244
raisePermissionError(
245245
"Impossible to apply `chmod` to file {}".format(obj_path)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp