Skip to content

Commit

Permalink
Reject invalid values near the calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 14, 2015
1 parent 6d3438f commit 0c7287c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/droonga/plugins/system/absorb_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ def report_progress
end

def progress_percentage
if @total_n_source_records.nil? or @total_n_source_records.zero?
return 0
end
progress = @n_processed_messages / @total_n_source_records
[(progress * 100).to_i, 100].min
end
Expand Down

0 comments on commit 0c7287c

Please sign in to comment.