We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scenario: Using redis store, and the store is remote
Expected behavior: If the store is unavailable, catch exceptions, log a warning, and just run the normal function.
Actual behavior: exceptions bubble up
The text was updated successfully, but these errors were encountered:
An example workaround, credit @tombo315
def memo_safe(**opts): """ Memoizes a function (fail-safe) :param opts: options to pass to Memoize call :return: the wrapped function. """ def outer(f): @wraps(f) def inner(*args, **kwargs): if memo is None: return f(*args, **kwargs) try: m_func = memo(f, **opts) ret = m_func(*args, **kwargs) except Exception as e: logger.warning("On memoized call: {}".format(str(e))) ret = f(*args, **kwargs) return ret return inner return outer
Sorry, something went wrong.
No branches or pull requests
Scenario: Using redis store, and the store is remote
Expected behavior: If the store is unavailable, catch exceptions, log a warning, and just run the normal function.
Actual behavior: exceptions bubble up
The text was updated successfully, but these errors were encountered: