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

Lazily instantiate underlying client #170

Merged
merged 3 commits into from Oct 9, 2023
Merged

Conversation

mattt
Copy link
Member

@mattt mattt commented Oct 9, 2023

#147 changed some logic in how the underlying networking client is initialized. Some clients that set the REPLICATE_API_TOKEN environment variable after importing the replicate package relied on that behavior, and are now getting authentication errors (#169)

This PR restores some of the original behavior by lazily instantiating the underlying client until the first request is made. This should resolve the regression observed by users who were modifying the environment after import.

Signed-off-by: Mattt Zmuda <mattt@replicate.com>
Signed-off-by: Mattt Zmuda <mattt@replicate.com>
Signed-off-by: Mattt Zmuda <mattt@replicate.com>
@mattt mattt merged commit 7fbbe66 into main Oct 9, 2023
7 checks passed
@mattt mattt deleted the mattt/lazily-initialize-client branch October 9, 2023 11:42
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

Successfully merging this pull request may close these issues.

None yet

1 participant