diff --git a/capi/__init__.py b/capi/__init__.py index b240b23..717601b 100644 --- a/capi/__init__.py +++ b/capi/__init__.py @@ -114,7 +114,7 @@ class CAPIAuthorizer: return row - def refresh_by_state(self, state: str, force_refresh=False, failure_tolerance=True) -> dict: + def refresh_by_state(self, state: str, force_refresh=False, failure_tolerance=config.default_failure_tolerance) -> dict: """ :param state: diff --git a/config.py b/config.py index 3a2c86c..9480f59 100644 --- a/config.py +++ b/config.py @@ -11,7 +11,7 @@ log_level = os.getenv('LOG_LEVEL', 'DEBUG').upper() access_key = os.getenv('access_key') db_location = os.getenv('db_location', 'companion-api.sqlite') - +default_failure_tolerance = os.getenv('default_failure_tolerance', 'True').lower() == 'true' REDIRECT_URL = requests.utils.quote(os.getenv('REDIRECT_URL', '')) AUTH_URL = 'https://auth.frontierstore.net/auth' TOKEN_URL = 'https://auth.frontierstore.net/token'