diff options
author | Alex Legler <alex@a3li.li> | 2015-02-23 21:58:05 +0100 |
---|---|---|
committer | Alex Legler <alex@a3li.li> | 2015-02-23 21:58:05 +0100 |
commit | 88d9781c469e27ca77901a05326f598821715b33 (patch) | |
tree | 111b6c5cd06e4e059089be7019bea7ccde9ccae2 /ag | |
parent | Silence encoding warnings (diff) | |
download | backend-88d9781c469e27ca77901a05326f598821715b33.tar.gz backend-88d9781c469e27ca77901a05326f598821715b33.tar.bz2 backend-88d9781c469e27ca77901a05326f598821715b33.zip |
Only occupy 3/4 of the processors
Diffstat (limited to 'ag')
-rwxr-xr-x | ag | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 |