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

Beanstalk watchers count check bugfix #530

Merged
merged 3 commits into from
Apr 27, 2014
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 1 addition & 4 deletions plugins/beanstalk/check-beanstalk-watchers-to-buried.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@ def run
rescue Beanstalk::NotFoundError
warning "Tube #{config[:tube]} not found"
end
if watchers
# subtract ourselves
watchers = watchers - 1
else
unless watchers
Copy link
Contributor

Choose a reason for hiding this comment

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

For future use - such things are better looking when squashed into something like

watchers = 0 unless watchers

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noted, thanks!

watchers = 0
end

Expand Down
5 changes: 1 addition & 4 deletions plugins/beanstalk/check-beanstalk-watchers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ def run
rescue Beanstalk::NotFoundError
warning "Tube #{config[:tube]} not found"
end
if watchers
# subtract ourselves
watchers = watchers - 1
else
unless watchers
watchers = 0
end
if config[:crit] && watchers < config[:crit]
Expand Down