Navigation Menu

Skip to content

Commit

Permalink
Use given internal connection lifetime as the default timeout of sess…
Browse files Browse the repository at this point in the history
…ions by EngineState itself
  • Loading branch information
piroor committed Apr 22, 2015
1 parent 0941a5a commit f11725c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/droonga/engine_state.rb
Expand Up @@ -130,7 +130,9 @@ def register_session(id, session, options={})
@sessions[id] = session
logger.trace("new session #{id} is registered. rest sessions=#{@sessions.size}")

timeout = options[:timeout] || DEFAULT_SESSION_TIMEOUT_SECONDS
timeout = options[:timeout] ||
@internal_connection_lifetime ||
DEFAULT_SESSION_TIMEOUT_SECONDS
session.set_timeout(@loop, timeout) do
logger.trace("session #{id} is timed out!")
unregister_session(id)
Expand Down

0 comments on commit f11725c

Please sign in to comment.