1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 18:53:21 +01:00

cleanup sleep-request retry delay code

more lines but easier to read I'd say
This commit is contained in:
Mike Fährmann 2024-03-11 21:34:00 +01:00
parent 4ccdba8ccb
commit 106dfdb4c3
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -203,9 +203,15 @@ class Extractor():
self.log.debug("%s (%s/%s)", msg, tries, retries+1)
if tries > retries:
break
self.sleep(
max(tries, self._interval()) if self._interval else tries,
"retry")
if self._interval:
seconds = self._interval()
if seconds < tries:
seconds = tries
else:
seconds = tries
self.sleep(seconds, "retry")
tries += 1
raise exception.HttpError(msg, response)