Navigation Menu

Skip to content

Commit

Permalink
Process progressIntervalSeconds option expectedly
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 14, 2015
1 parent 9b37952 commit 44b7296
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/droonga/plugins/system/absorb_data.rb
Expand Up @@ -63,7 +63,7 @@ def handle
on_finish
end

@start_time = Time.now
@previous_report_time = Time.now

begin
@n_processed_messages = 0
Expand All @@ -78,8 +78,10 @@ def handle
"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?
now = Time.now
elapsed_seconds = (now - @previous_report_time).to_i
if elapsed_seconds >= progress_interval_seconds
@previous_report_time = now
report_progress
end
rescue Exception => exception
Expand Down

0 comments on commit 44b7296

Please sign in to comment.