MCPcopy Index your code
hub / github.com/pyload/pyload / retry

Method retry

module/plugins/internal/Base.py:450–475  ·  view source on GitHub ↗

Retries and begin again from the beginning :param attemps: number of maximum retries :param wait: time to wait in seconds before retry :param msg: message passed to fail if attemps value was reached

(self, attemps=5, wait=1, msg="", msgfail=_("Max retries reached"))

Source from the content-addressed store, hash-verified

448 raise Retry(encode(msg)) # @TODO: Remove `encode` in 0.4.10
449
450 def retry(self, attemps=5, wait=1, msg="", msgfail=_("Max retries reached")):
451 """
452 Retries and begin again from the beginning
453
454 :param attemps: number of maximum retries
455 :param wait: time to wait in seconds before retry
456 :param msg: message passed to fail if attemps value was reached
457 """
458 frame = inspect.currentframe()
459
460 try:
461 id = frame.f_back.f_lineno
462 finally:
463 del frame #: Delete the frame or it wont be cleaned
464
465 if id not in self.retries:
466 self.retries[id] = 0
467
468 if 0 < attemps <= self.retries[id]:
469 self.fail(msgfail)
470
471 self.retries[id] += 1
472
473 self.wait(wait)
474
475 raise Retry(encode(msg)) # @TODO: Remove `encode` in 0.4.10
476
477 def retry_captcha(self, attemps=10, wait=1, msg="", msgfail=_("Max captcha retries reached")):
478 self.captcha.invalid(msg)

Callers 15

retry_captchaMethod · 0.95
check_errorsMethod · 0.45
handle_multiMethod · 0.45
_post_parametersMethod · 0.45
check_errorsMethod · 0.45
decryptMethod · 0.45
decryptMethod · 0.45
check_errorsMethod · 0.45
decryptMethod · 0.45
check_errorsMethod · 0.45
my_post_processMethod · 0.45
handle_freeMethod · 0.45

Calls 5

failMethod · 0.95
waitMethod · 0.95
RetryClass · 0.85
encodeFunction · 0.85
_Function · 0.50

Tested by

no test coverage detected