Skip to content

Commit

Permalink
Use more meaningful name for path to serf command
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 21, 2015
1 parent 169f12a commit d9e54d7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/droonga/serf.rb
Expand Up @@ -43,7 +43,7 @@ def tags_file
include Loggable

def initialize(name, options={})
@serf = nil
@serf_command = nil
@name = NodeName.parse(name)
@verbose = options[:verbose] || false
@service_installation = ServiceInstallation.new
Expand All @@ -59,7 +59,7 @@ def run_agent(loop)
end
tags_file = self.class.tags_file
FileUtils.mkdir_p(tags_file.dirname)
agent = Agent.new(loop, @serf,
agent = Agent.new(loop, @serf_command,
@name.host, agent_port, rpc_port,
"-node", @name.to_s,
"-event-handler", "droonga-engine-serf-event-handler",
Expand Down Expand Up @@ -232,11 +232,11 @@ def cluster_id

private
def ensure_serf
@serf ||= find_system_serf
return if @serf
@serf_command ||= find_system_serf
return if @serf_command

serf_path = self.class.path
@serf = serf_path.to_s
@serf_command = serf_path.to_s
return if serf_path.executable?
downloader = Downloader.new(serf_path)
downloader.download
Expand All @@ -253,7 +253,7 @@ def find_system_serf

def run_command(command, *options)
ensure_serf
command = Command.new(@serf, command,
command = Command.new(@serf_command, command,
"-rpc-addr", rpc_address,
*options)
command.verbose = @verbose
Expand Down

0 comments on commit d9e54d7

Please sign in to comment.