Commit 04cc7187e2272e1e66adfe392f05ddae5cb639ac
1 parent
3aa7898c
Exists in
master
and in
23 other branches
spaminator: load progress_bar only on development
Showing
1 changed file
with
6 additions
and
6 deletions
Show diff stats
plugins/spaminator/lib/spaminator_plugin/spaminator.rb
| ... | ... | @@ -70,17 +70,17 @@ class SpaminatorPlugin::Spaminator |
| 70 | 70 | self.class.log("Starting to process all comments") |
| 71 | 71 | comments = comments_to_process |
| 72 | 72 | total = comments.count |
| 73 | - pbar = ProgressBar.new("☢ Comments", total) | |
| 73 | + pbar = ProgressBar.new("☢ Comments", total) if Rails.env.development? | |
| 74 | 74 | comments.each do |comment| |
| 75 | 75 | begin |
| 76 | 76 | process_comment(comment) |
| 77 | 77 | rescue |
| 78 | 78 | register_fail(:comments, comment) |
| 79 | 79 | end |
| 80 | - pbar.inc | |
| 80 | + pbar.inc if Rails.env.development? | |
| 81 | 81 | end |
| 82 | 82 | @report.processed_comments = total |
| 83 | - pbar.finish | |
| 83 | + pbar.finish if Rails.env.development? | |
| 84 | 84 | self.class.log("All comments processed") |
| 85 | 85 | end |
| 86 | 86 | |
| ... | ... | @@ -88,14 +88,14 @@ class SpaminatorPlugin::Spaminator |
| 88 | 88 | self.class.log("Starting to process all people") |
| 89 | 89 | people = people_to_process |
| 90 | 90 | total = people.count |
| 91 | - pbar = ProgressBar.new("☢ People", total) | |
| 91 | + pbar = ProgressBar.new("☢ People", total) if Rails.env.development? | |
| 92 | 92 | people.find_each do |person| |
| 93 | 93 | process_person_by_comments(person) |
| 94 | 94 | process_person_by_no_network(person) |
| 95 | - pbar.inc | |
| 95 | + pbar.inc if Rails.env.development? | |
| 96 | 96 | end |
| 97 | 97 | @report.processed_people = total |
| 98 | - pbar.finish | |
| 98 | + pbar.finish if Rails.env.development? | |
| 99 | 99 | self.class.log("All people processed") |
| 100 | 100 | end |
| 101 | 101 | ... | ... |