[Groonga-commit] groonga/fluent-plugin-groonga at 0b45043 [master] in: load is always emitted

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Sep 2 16:54:00 JST 2016


Kouhei Sutou	2016-09-02 16:54:00 +0900 (Fri, 02 Sep 2016)

  New Revision: 0b45043d47f062990ff47c3246112b9d048b0b52
  https://github.com/groonga/fluent-plugin-groonga/commit/0b45043d47f062990ff47c3246112b9d048b0b52

  Message:
    in: load is always emitted

  Modified files:
    lib/fluent/plugin/in_groonga.rb

  Modified: lib/fluent/plugin/in_groonga.rb (+16 -7)
===================================================================
--- lib/fluent/plugin/in_groonga.rb    2016-09-02 16:31:49 +0900 (403802b)
+++ lib/fluent/plugin/in_groonga.rb    2016-09-02 16:54:00 +0900 (e7cbfaa)
@@ -221,18 +221,27 @@ module Fluent
         end
 
         def on_response_complete(response)
-          case response
-          when Array
-            return_code = response[0][0]
-            if return_code.zero?
-              @input.emit(@request_handler.command,
-                          @request_handler.params)
-            end
+          if need_emit?(response)
+            @input.emit(@request_handler.command,
+                        @request_handler.params)
           end
           on_write_complete do
             @repeater.close
           end
         end
+
+        private
+        def need_emit?(response)
+          return true if @request_handler.command == "load"
+
+          case response
+          when Array
+            return_code = response[0][0]
+            return_code.zero?
+          else
+            false
+          end
+        end
       end
 
       class RequestHandler
-------------- next part --------------
HTML����������������������������...
Download 



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