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:
parent
4ccdba8ccb
commit
106dfdb4c3
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user