diff options
author | vjpai <vpai@google.com> | 2016-03-29 18:31:34 -0700 |
---|---|---|
committer | vjpai <vpai@google.com> | 2016-03-29 18:31:34 -0700 |
commit | e8ff3889f5d0389c1f70f3e8f2b3054d187352b2 (patch) | |
tree | 592a2d768d84e740b9ee99c4e47a6a833ecd90e3 /src/ruby | |
parent | 45be26ef0d5c466a30273e3702103d6b0cf3b4ab (diff) |
Fix scope on an each - no need for class scope
Diffstat (limited to 'src/ruby')
-rwxr-xr-x | src/ruby/qps/worker.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ruby/qps/worker.rb b/src/ruby/qps/worker.rb index 1ebf129a13..8555888106 100755 --- a/src/ruby/qps/worker.rb +++ b/src/ruby/qps/worker.rb @@ -53,17 +53,18 @@ class WorkerServiceImpl < Grpc::Testing::WorkerService::Service def run_server(reqs) q = EnumeratorQueue.new(self) Thread.new { + bms = '' reqs.each do |req| case req.argtype.to_s when 'setup' - @bms = BenchmarkServer.new(req.setup, @server_port) - q.push(Grpc::Testing::ServerStatus.new(stats: @bms.mark(false), port: @bms.get_port)) + bms = BenchmarkServer.new(req.setup, @server_port) + q.push(Grpc::Testing::ServerStatus.new(stats: bms.mark(false), port: bms.get_port)) when 'mark' - q.push(Grpc::Testing::ServerStatus.new(stats: @bms.mark(req.mark.reset), cores: cpu_cores)) + q.push(Grpc::Testing::ServerStatus.new(stats: bms.mark(req.mark.reset), cores: cpu_cores)) end end q.push(self) - @bms.stop + bms.stop } q.each_item end |