YUKI Hiroshi
null+****@clear*****
Thu Jan 15 15:34:55 JST 2015
YUKI Hiroshi 2015-01-15 15:34:55 +0900 (Thu, 15 Jan 2015) New Revision: 6cfcc89d24700b95310fcb011f3ccff8fbdaf343 https://github.com/droonga/droonga-engine/commit/6cfcc89d24700b95310fcb011f3ccff8fbdaf343 Message: Don't return "nil" as a volume Modified files: lib/droonga/catalog/replicas_volume.rb Modified: lib/droonga/catalog/replicas_volume.rb (+10 -2) =================================================================== --- lib/droonga/catalog/replicas_volume.rb 2015-01-15 12:38:43 +0900 (6d29e9e) +++ lib/droonga/catalog/replicas_volume.rb 2015-01-15 15:34:55 +0900 (244c6c6) @@ -44,10 +44,18 @@ module Droonga case how when :top replicas = live_replicas(active_nodes) - [replicas.first] + if replicas.empty? + [] + else + [replicas.first] + end when :random replicas = live_replicas(active_nodes) - [replicas.sample] + if replicas.empty? + [] + else + [replicas.sample] + end when :all live_replicas(active_nodes) else -------------- next part -------------- HTML����������������������������...Download