[Groonga-commit] droonga/fluent-plugin-droonga at 4a05913 [master] job pusher: handle ready but queue isn't empty case

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Mar 23 18:06:30 JST 2014


Kouhei Sutou	2014-03-23 18:06:30 +0900 (Sun, 23 Mar 2014)

  New Revision: 4a0591345a24b8cbed75b31e74e362eb1f72c5c2
  https://github.com/droonga/fluent-plugin-droonga/commit/4a0591345a24b8cbed75b31e74e362eb1f72c5c2

  Message:
    job pusher: handle ready but queue isn't empty case

  Modified files:
    lib/droonga/job_pusher.rb

  Modified: lib/droonga/job_pusher.rb (+9 -4)
===================================================================
--- lib/droonga/job_pusher.rb    2014-03-23 17:45:58 +0900 (eca2efe)
+++ lib/droonga/job_pusher.rb    2014-03-23 18:06:30 +0900 (4f89344)
@@ -88,11 +88,16 @@ module Droonga
 
       def push(message)
         job = message.to_msgpack
-        if****@buffe*****? and !@ready_workers.empty?
-          worker = @ready_workers.shift
-          worker.write(job)
-        else
+        if @ready_workers.empty?
           @buffers << job
+        else
+          worker = @ready_workers.shift
+          if****@buffe*****?
+            worker.write(job)
+          else
+            @buffers << job
+            worker.write(@buffers.shift)
+          end
         end
       end
     end
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index