Navigation Menu

Skip to content

Commit

Permalink
Reject error case near the actual compution
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 14, 2015
1 parent 6556398 commit 32abafc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/droonga/plugins/system/absorb_data.rb
Expand Up @@ -73,8 +73,7 @@ def handle
"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?
if (elapsed_seconds % progress_interval_seconds).zero?
report_progress
end
end
Expand Down Expand Up @@ -111,6 +110,9 @@ def dumper_params
end

def report_progress
if @n_processed_messages.nil? or @total_n_source_records.nil?
return
end
forward("#{prefix}.progress",
"nProcessedMessages" => @n_processed_messages,
"percentage" => progress_percentage,
Expand Down

0 comments on commit 32abafc

Please sign in to comment.