Navigation Menu

Skip to content

Commit

Permalink
Clear timer if it is correctly processed
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 6, 2015
1 parent 2a9f6fa commit e7a7b64
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/droonga/engine_state.rb
Expand Up @@ -133,6 +133,8 @@ def register_session(id, session)
end

def unregister_session(id)
session = @sessions[id]
session.finish
@sessions.delete(id)
unless have_session?
@on_finish.call if @on_finish
Expand Down
5 changes: 5 additions & 0 deletions lib/droonga/session.rb
Expand Up @@ -49,6 +49,11 @@ def start
end
end

def finish
@timeout_timer.detach if @timeout_timer
@timeout_timer = nil
end

def receive(name, value)
tasks = @inputs[name]
logger.trace("receive: process response",
Expand Down

0 comments on commit e7a7b64

Please sign in to comment.