aboutsummaryrefslogtreecommitdiff
path: root/ag
diff options
context:
space:
mode:
authorAlex Legler <alex@a3li.li>2015-02-23 21:58:05 +0100
committerAlex Legler <alex@a3li.li>2015-02-23 21:58:05 +0100
commit88d9781c469e27ca77901a05326f598821715b33 (patch)
tree111b6c5cd06e4e059089be7019bea7ccde9ccae2 /ag
parentSilence encoding warnings (diff)
downloadbackend-88d9781c469e27ca77901a05326f598821715b33.tar.gz
backend-88d9781c469e27ca77901a05326f598821715b33.tar.bz2
backend-88d9781c469e27ca77901a05326f598821715b33.zip
Only occupy 3/4 of the processors
Diffstat (limited to 'ag')
-rwxr-xr-xag6
1 files changed, 3 insertions, 3 deletions
diff --git a/ag b/ag
index 73c189b..bcb1ac6 100755
--- a/ag
+++ b/ag
@@ -115,13 +115,13 @@ def do_full
messages = $maildir.list(:cur)
- Parallel.each(messages, progress: "Importing #{$options.name}") do |maildir_message|
+ Parallel.each(messages, in_processes: Ag::Utils.proc_count, progress: "Importing #{$options.name}") do |maildir_message|
mail = maildir_message.data
begin
Ag::Storage.store($options.name, mail, maildir_message.unique_name)
rescue => e
- $stderr.puts "Cannot save message #{mail.message_id}: #{e.message}"
+ $stderr.puts "Cannot save message #{mail.message_id}: (#{e.class}) #{e.message}" if $options.debug
next
end
end
@@ -132,7 +132,7 @@ end
def do_incremental
messages = $maildir.list(:cur)
- Parallel.each(messages, progress: "Importing #{$options.name}") do |maildir_message|
+ Parallel.each(messages, in_processes: Ag::Utils.proc_count, progress: "Importing #{$options.name}") do |maildir_message|
mail = maildir_message.data
begin