Navigation Menu

Skip to content

Commit

Permalink
Output readable trace log for sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 1, 2015
1 parent 08c1c18 commit 5efa6ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions lib/droonga/dispatcher.rb
Expand Up @@ -163,7 +163,6 @@ def process_internal_message(message)
id = message["id"]
session = @engine_state.find_session(id)
if session
logger.trace("process_internal_message: session exists", :session => session)
session.receive(message["input"], message["value"])
else
logger.trace("process_internal_message: no session")
Expand All @@ -173,7 +172,6 @@ def process_internal_message(message)
dataset = message["dataset"] || @message["dataset"]
collector_runner = @collector_runners[dataset]
session = session_planner.create_session(id, self, collector_runner)
logger.trace("process_internal_message: session created", :session => session)
@engine_state.register_session(id, session)
else
logger.error("no steps error", :id => id, :message => message)
Expand Down
4 changes: 4 additions & 0 deletions lib/droonga/session.rb
Expand Up @@ -34,18 +34,22 @@ def done?

def start
tasks = @inputs[nil] || []
logger.trace("start: no task!") if tasks.empty?
tasks.each do |task|
local_message = {
"id" => @id,
"task" => task,
}
logger.trace("start: dispatching local message", :message => local_message)
@dispatcher.process_local_message(local_message)
@n_dones += 1
end
end

def receive(name, value)
tasks = @inputs[name]
logger.trace("receive: process response",
:name => name, :value => value, :task => tasks)
unless tasks
#TODO: result arrived before its query
return
Expand Down

0 comments on commit 5efa6ef

Please sign in to comment.