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

Invalidate memorized object http on host changes #43

Merged
merged 1 commit into from
Mar 15, 2022

Conversation

miry
Copy link
Contributor

@miry miry commented Mar 14, 2022

Currently http is cached and could be never changed.
Make sure there is possible to update toxiproxy client to different
server, invalidate cache for http.

@miry miry self-assigned this Mar 14, 2022
@miry miry force-pushed the invalidate-cache-on-host-change branch from 087f8b7 to 86b0cc7 Compare March 14, 2022 17:08
@miry miry added the Toxiproxy label Mar 14, 2022
lib/toxiproxy.rb Outdated
Comment on lines 71 to 74
if defined? @http
@http.finish() if @http && @http.started?
@http = nil
end
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could extract it into some sort of method to reset all connections and it might be useful in the tests too

I throw some ideas (from more suitable to less)

  reset_http_client!
  # or
  reset_http!
  # or
  reset_http_connections!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you! Now it looks cleaner ❤️

Currently http is cached and could be never changed.
Make sure there is possible to update toxiproxy client to different
server, invalidate cache for http.
@miry miry force-pushed the invalidate-cache-on-host-change branch from 86b0cc7 to d6b911a Compare March 15, 2022 12:16
@miry miry merged commit 47783ac into master Mar 15, 2022
@miry miry deleted the invalidate-cache-on-host-change branch March 15, 2022 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants