Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(0)  |  Derive(0)  |  Import(2)

        def retry(fun):

    @wraps(fun)
    def _inner(*args, **kwargs):
        max_retries = kwargs.pop('max_retries', 3)

        for retries in range(max_retries):
            try:
                return fun(*args, **kwargs)
            except (DatabaseError, InvalidRequestError, StaleDataError):
                logger.warning(
                    "Failed operation %s. Retrying %s more times.",
                    fun.__name__, max_retries - retries - 1,
                    exc_info=True,
                )
                if retries + 1 >= max_retries:
                    raise

    return _inner
        


src/c/e/celery-HEAD/celery/tests/backends/test_database.py   celery(Download)
    DatabaseBackend = Task = TaskSet = retry = None  # noqa
else:
    from celery.backends.database import DatabaseBackend, retry
    from celery.backends.database.models import Task, TaskSet
 

src/c/e/celery-3.1.11/celery/tests/backends/test_database.py   celery(Download)
    DatabaseBackend = Task = TaskSet = retry = None  # noqa
else:
    from celery.backends.database import DatabaseBackend, retry
    from celery.backends.database.models import Task, TaskSet