Skip to content
New issue

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

Do not initialize the api key until needed #5

Open
nvahalik opened this issue Jan 26, 2021 · 1 comment
Open

Do not initialize the api key until needed #5

nvahalik opened this issue Jan 26, 2021 · 1 comment

Comments

@nvahalik
Copy link

nvahalik commented Jan 26, 2021

Instantiating the class with the key always reaches out to the API, even if it is never needed. This can add unwanted overhead.

I'd recommend not getting the API token until executing a task that requires it. That way there is no "cost" for instantiating it and never using it.

@SolneilE
Copy link

Endorsing this recommendation 100%. Recently had my site become unavailable because the qencode API server was offline - every request that had to load the library would time out, though no API calls were required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants