diff --git a/app/controllers/admin/e_paper_subscribers_controller.rb b/app/controllers/admin/e_paper_subscribers_controller.rb index 58428c1..17fd138 100644 --- a/app/controllers/admin/e_paper_subscribers_controller.rb +++ b/app/controllers/admin/e_paper_subscribers_controller.rb @@ -58,7 +58,7 @@ class Admin::EPaperSubscribersController < OrbitAdminController subscribe_sheet = workbook['Subscribe'] unsubscribe_sheet = workbook['Unsubscribe'] all_count = (subscribe_sheet ? (subscribe_sheet.count - 1) : 0) + (unsubscribe_sheet ? (unsubscribe_sheet.count - 1) : 0) - puts_every_count = all_count * 3 / 100 + puts_every_count = [all_count * 3 / 100, 1].max current_count = 0 finish_percent = 0 thread.update(:status=>{:status=>'Importing','all_count'=>all_count,'current_count'=>current_count,'finish_percent'=>finish_percent}) @@ -145,7 +145,7 @@ class Admin::EPaperSubscribersController < OrbitAdminController end if subscriber_ids all_count = subscriber_ids.count - puts_every_count = all_count * 3 / 100 + puts_every_count = [all_count * 3 / 100, 1].max current_count = 0 finish_percent = 0 thread.update(:status=>{:status=>'Deleting','all_count'=>all_count,'current_count'=>current_count,'finish_percent'=>finish_percent})