Skip to content

Commit

Permalink
Format numeric every for server
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonreinke committed May 19, 2017
1 parent f0f28c8 commit 0cdf0ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/resque/scheduler/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,13 @@ def schedule_interval(config)

def schedule_interval_every(every)
every = [*every]
s = 'every: ' << every.first
s = 'every: ' << "#{every.first}#{'s' if every.first.is_a?(Numeric)}"

return s unless every.length > 1

s << ' ('
meta = every.last.map do |key, value|
"#{key.to_s.tr('_', ' ')} #{value}"
"#{key.to_s.tr('_', ' ')} #{value}#{'s' if value.is_a?(Numeric)}"
end
s << meta.join(', ') << ')'
end
Expand Down

0 comments on commit 0cdf0ae

Please sign in to comment.