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

add relative_require for other timers #130

Merged
merged 5 commits into from
May 27, 2019
Merged
Show file tree
Hide file tree
Changes from 2 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
12 changes: 3 additions & 9 deletions lib/circuitbox/circuit_breaker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,10 @@ def run(circuitbox_exceptions: true)
end

def open?
if open_flag?
true
else
false
end
circuit_store.key?(open_storage_key)
end
alias :open_flag? :open?
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason for keeping open_flag? around besides not having to rename the open_flag? calls to open??

Copy link
Contributor Author

@ritikesh ritikesh May 27, 2019

Choose a reason for hiding this comment

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

@matthewshafer: Since this is a private method, I don't see a reason why we shouldn't. Updated, pls have a look.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for updating. Sorry it took so long for me to get to this, my notification preferences on this repo were removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for merging! Do you know anybody I can reach out to for this(yammer/yam#54)? This one's been open for a while as well.

Copy link

Choose a reason for hiding this comment

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

@matthewshafer Any chances for a new release soon?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@ritikesh I'll ask around.

@Sija I'll get out another pre this week. I won't have documentation and upgrade guide done this week so it won't be a final release.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. 👍

Copy link

Choose a reason for hiding this comment

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

@matthewshafer Doesn't matter as long it's published on RubyGems :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

@Sija 2.0.0.pre2 is on rubygems, let me know if you run into any issues.

Copy link

Choose a reason for hiding this comment

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

@matthewshafer Works like a charm, thanks!

private :open_flag?

def error_rate(failures = failure_count, success = success_count)
all_count = failures + success
Expand Down Expand Up @@ -169,10 +167,6 @@ def close!
logger.debug(circuit_closed_message)
end

def open_flag?
circuit_store.key?(open_storage_key)
end

def half_open?
circuit_store.key?(half_open_storage_key)
end
Expand Down
2 changes: 2 additions & 0 deletions lib/circuitbox/configuration.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
require_relative 'memory_store'
require_relative 'timer/monotonic'
require_relative 'timer/null'
require_relative 'timer/simple'
require_relative 'notifier/active_support'
require_relative 'notifier/null'
Expand Down