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

Connection memoization #265

Merged
merged 2 commits into from Jun 4, 2012
Merged

Connection memoization #265

merged 2 commits into from Jun 4, 2012

Conversation

laserlemon
Copy link
Sponsor Collaborator

Connections are being memoized incorrectly when they're created in Twitter::Connection#connection because the given options are being ignored. Currently, only options[:endpoint] affects the resulting Faraday connection so this change memoizes created connections once per given endpoint.

This issue would pop up if one were to make a rate limit request (one endpoint) and then use the same client to make a search request (different endpoint). The search request would be performed on the first (memoized) endpoint.

@sferik
Copy link
Owner

sferik commented Jun 4, 2012

Looks good. Other than endpoints is there anything we need to worry about being cached?

@laserlemon
Copy link
Sponsor Collaborator Author

The endpoint is the only option we actually use in the connection method so no, nothing else at the moment. Unless a client's own configuration changes after initialization for some reason.

sferik added a commit that referenced this pull request Jun 4, 2012
@sferik sferik merged commit a3e8d6f into master Jun 4, 2012
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

2 participants