rex.utilities.utilities.Retry

class Retry(tries=3, n_sec=1)[source]

Bases: object

Retry Decorator to run a function multiple times

Parameters
  • tries (int, optional) – Number if times to retry function, by default 2

  • n_sec (int, optional) – Number of seconds to wait between tries, by default 1

Methods

__call__(func, *args, **kwargs)[source]

Decorator call

Parameters
  • func (obj) – Function to retry on Exception

  • args (tuple) – Function arguments

  • kwargs (dict) – Function kwargs