| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9e68ea1 commit b4fd74c
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -230,16 +230,16 @@ def store(self, istream): | |||
| 230 | 230 | # end rename only if needed | |
| 231 | 231 | ||
| 232 | 232 | # 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. | ||
| 234 | 234 | # The total maximum wait time is 1000ms, which should be vastly enough for the | |
| 235 | 235 | # OS to return and commit the file to disk. | |
| 236 | - for exp_backoff_ms in [1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 181]: | ||
| 236 | + for backoff_ms in [1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 181]: | ||
| 237 | 237 | with suppress(PermissionError): | |
| 238 | 238 | # make sure its readable for all ! It started out as rw-- tmp file | |
| 239 | 239 | # but needs to be rwrr | |
| 240 | 240 | chmod(obj_path, self.new_objects_mode) | |
| 241 | 241 | break | |
| 242 | - time.sleep(exp_backoff_ms / 1000.0) | ||
| 242 | + time.sleep(backoff_ms / 1000.0) | ||
| 243 | 243 | else: | |
| 244 | 244 | raise PermissionError( | |
| 245 | 245 | "Impossible to apply `chmod` to file {}".format(obj_path) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments