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
Hello, thank you for a grate tool!
Is it possible to not write error messages in case of giving up due to using giveup attribute?
Case is similar to this #108, when I need to check for some fields of exceptions to decide:
def _connection_retry_backoff_handler(exception: Exception) -> bool: if ( isinstance(exception, DBAPIError) and hasattr(exception, "orig") and isinstance(exception.orig.__cause__, asyncpg.PostgresConnectionError) # type: ignore[union-attr] ): logger.debug("postgres_reconnect, backoff triggered") return False logger.debug("postgres_reconnect, giving up on backoff") return True def postgres_reconnect(func: typing.Callable[P, typing.Awaitable[T]]) -> typing.Callable[P, typing.Awaitable[T]]: @backoff.on_exception( backoff.expo, (DBAPIError,), max_tries=settings.DB_UTILS_CONNECTION_TRIES, giveup=_connection_retry_backoff_handler, ) @functools.wraps(func) async def wrapped_method(*args: P.args, **kwargs: P.kwargs) -> T: return await func(*args, **kwargs) return wrapped_method
Because now I receive this
Giving up create_user(...) after 1 tries
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello, thank you for a grate tool!
Is it possible to not write error messages in case of giving up due to using giveup attribute?
Case is similar to this #108, when I need to check for some fields of exceptions to decide:
Because now I receive this
The text was updated successfully, but these errors were encountered: