self.datetime = datetime.now(utc_tz)
- def _retry(self, fn, exc_class, *args):
- """Call ``fn`` repeatedly with ``*args``, until it stops raising
+ def _retry(self, fn, exc_class):
+ """Call ``fn`` repeatedly, until it stops raising
``exc_class`` or it has been called ``MAX_RETRIES`` times (in which case
:exc:`MaxRetriesExceededError` is raised).
by fn, means it has failed and should be called again.
*Any other exception will propagate normally, cancelling the
- :param *args: Optional arguments to pass to ``fn``
while tries < self.MAX_RETRIES:
# Nothing was raised: we're done !
- for transactor in transactors:
- self._retry(self._apply_and_save_target, ExpectedValueError, *transactor)
+ for getter, setter in transactors:
+ lambda: self._apply_and_save_target(getter, setter),