Navigation Menu

Skip to content

Commit

Permalink
Add nil check for immediate shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Apr 22, 2014
1 parent e5d6cb7 commit 325622a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/droonga/job_pusher.rb
Expand Up @@ -27,6 +27,7 @@ def initialize(loop, base_path)
@loop = loop
@socket_path = "#{base_path}.#{Process.pid}.#{object_id}.sock"
@job_queue = JobQueue.new(@loop)
@server = nil
end

def start
Expand All @@ -39,12 +40,12 @@ def start
end

def close
@server.close
@server.close if @server
end

def shutdown
logger.trace("shutdown: start")
@server.close
@server.close if @server
@job_queue.close
FileUtils.rm_f(@socket_path)
logger.trace("shutdown: done")
Expand Down

0 comments on commit 325622a

Please sign in to comment.