[Groonga-commit] long-long-float/droonga-engine at aa52a3d [master] Don't parse non-JSON output as a JSON

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Aug 29 12:25:35 JST 2014


YUKI Hiroshi	2014-08-29 12:25:35 +0900 (Fri, 29 Aug 2014)

  New Revision: aa52a3d95e0c8f04a33d6b3f1bcf5cf03ea14ff8
  https://github.com/long-long-float/droonga-engine/commit/aa52a3d95e0c8f04a33d6b3f1bcf5cf03ea14ff8

  Message:
    Don't parse non-JSON output as a JSON

  Modified files:
    lib/droonga/serf.rb

  Modified: lib/droonga/serf.rb (+3 -1)
===================================================================
--- lib/droonga/serf.rb    2014-08-29 12:19:19 +0900 (011738d)
+++ lib/droonga/serf.rb    2014-08-29 12:25:35 +0900 (c5e4047)
@@ -99,6 +99,7 @@ module Droonga
       options = ["-format", "json"] + additional_options_from_payload(payload)
       options += [query, JSON.generate(payload)]
       result = run_once("query", *options)
+      result[:result] = JSON.parse(result[:result])
       if payload["node"]
         responses = result[:result]["Responses"]
         response = responses[payload["node"]]
@@ -119,6 +120,7 @@ module Droonga
       ensure_serf
       nodes = {}
       result = run_once("members", "-format", "json")
+      result[:result] = JSON.parse(result[:result])
       members = result[:result]
       members["members"].each do |member|
         if member["status"] == "alive"
@@ -265,7 +267,7 @@ module Droonga
       def run_once
         stdout, stderror, status = Open3.capture3(@serf, @command, *@options, :pgroup => true)
         {
-          :result => JSON.parse(stdout),
+          :result => stdout,
           :error  => stderror,
           :status => status,
         }
-------------- next part --------------
HTML����������������������������...
Download 



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