Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ad_api/base/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@

log = logging.getLogger(__name__)
role_cache = TTLCache(maxsize=int(os.environ.get('AD_API_AUTH_CACHE_SIZE', 10)), ttl=3200)
_DEFAULT_MARKETPLACE = Marketplaces[os.environ['AD_API_DEFAULT_MARKETPLACE']] if 'AD_API_DEFAULT_MARKETPLACE' in os.environ else Marketplaces.EU


class Client(BaseClient):
def __init__(
Expand All @@ -37,6 +35,9 @@ def __init__(
access_token: Optional[str] = None,
verify_additional_credentials: bool = True,
):
if marketplace is None:
marketplace = Marketplaces[os.environ['AD_API_DEFAULT_MARKETPLACE']] if 'AD_API_DEFAULT_MARKETPLACE' in os.environ else Marketplaces.EU

self.credentials = CredentialProvider(account, credentials, verify_additional_credentials).credentials
self._auth = AccessTokenClient(
credentials=self.credentials,
Expand Down