Navigation Menu

Skip to content

Commit

Permalink
Define default messages per second as a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 10, 2015
1 parent 59b366a commit 2184e0c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/droonga/plugin/async_command.rb
Expand Up @@ -47,12 +47,14 @@ def request
@message.request
end

DEFAULT_MESSAGES_PER_SECOND = 10000

def messages_per_seconds
request = (@message.request || {})
minimum_messages_per_seconds = 10
[
minimum_messages_per_seconds,
(request["messagesPerSecond"] || 10000).to_i,
(request["messagesPerSecond"] || DEFAULT_MESSAGES_PER_SECOND).to_i,
].max
end
end
Expand Down

0 comments on commit 2184e0c

Please sign in to comment.