Navigation Menu

Skip to content

Commit

Permalink
Count up number of processed messages correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 14, 2015
1 parent a4c3022 commit 4afb781
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/droonga/plugins/system/absorb_data.rb
Expand Up @@ -61,6 +61,7 @@ def handle
@start_time = Time.now

begin
@n_processed_messages = 0
@total_n_source_records = nil
get_total_n_source_records do |count|
@total_n_source_records = count
Expand All @@ -70,6 +71,7 @@ def handle
@messenger.forward(message,
"to" => my_node_name,
"type" => message["type"])
@n_processed_messages += 1
elapsed_seconds = (Time.now - @start_time).to_i
if (elapsed_seconds % progress_interval_seconds).zero? and
not @total_n_source_records.nil?
Expand Down

0 comments on commit 4afb781

Please sign in to comment.