diff --git a/app/controllers/admin/plow_controller.rb b/app/controllers/admin/plow_controller.rb index 420240c..9119692 100644 --- a/app/controllers/admin/plow_controller.rb +++ b/app/controllers/admin/plow_controller.rb @@ -33,12 +33,13 @@ class Admin::PlowController < OrbitAdminController host = uri.host ip = @setting.ip concurrent = @setting.concurrent + rate = @setting.rate scheme = uri.scheme Thread.new do if !ip.blank? - `ulimit -n 100000 && #{Binary} #{scheme}://#{ip}#{uri.request_uri} --host=#{host} --listen=#{SocketFile} -c#{concurrent} --summary > #{LogFile}` + `ulimit -n 100000 && #{Binary} #{scheme}://#{ip}#{uri.request_uri} --host=#{host} --listen=#{SocketFile} -c#{concurrent} --rate #{rate} --summary > #{LogFile}` else - `ulimit -n 100000 && #{Binary} #{@setting.url} --listen=#{SocketFile} -c#{concurrent} --summary > #{LogFile}` + `ulimit -n 100000 && #{Binary} #{@setting.url} --listen=#{SocketFile} -c#{concurrent} --rate #{rate} --summary > #{LogFile}` end end max_wait = 10 diff --git a/app/models/plow_setting.rb b/app/models/plow_setting.rb index 26eac36..9545a0c 100644 --- a/app/models/plow_setting.rb +++ b/app/models/plow_setting.rb @@ -5,4 +5,5 @@ class PlowSetting field :concurrent, type: Integer, :default => 1 field :ip, type: String field :url, type: String + field :rate, type: Integer, :default => 5000 end \ No newline at end of file diff --git a/app/views/admin/plow/setting.html.erb b/app/views/admin/plow/setting.html.erb index 3b8b97c..f6f99ed 100644 --- a/app/views/admin/plow/setting.html.erb +++ b/app/views/admin/plow/setting.html.erb @@ -25,6 +25,13 @@ +
+ +
+ <%= f.number_field :rate, :class => 'input-large' %> +
+
+ <% if !@logContent.blank? %>