From 150dd36cac4206d784723d93f92ad771b21161d2 Mon Sep 17 00:00:00 2001 From: bohung Date: Sat, 28 May 2022 17:43:11 +0800 Subject: [PATCH] Fix bug. --- app/controllers/admin/e_paper_subscribers_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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})