diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2015-02-23 14:44:14 -0800 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2015-02-23 14:44:14 -0800 |
commit | 45f28da0876f572b0bc5d81b7baeefda1b2b108f (patch) | |
tree | b6507a93872967fb9f85a30706d96d278f53c055 /ag | |
parent | hello linux (diff) | |
download | backend-45f28da0876f572b0bc5d81b7baeefda1b2b108f.tar.gz backend-45f28da0876f572b0bc5d81b7baeefda1b2b108f.tar.bz2 backend-45f28da0876f572b0bc5d81b7baeefda1b2b108f.zip |
Include a --jobs parameter.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'ag')
-rwxr-xr-x | ag | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -24,6 +24,7 @@ $options.index_only = false $options.no_threading = false $options.debug = false $options.readonly = false +$options.jobs = false op = OptionParser.new do |opts| opts.banner = "Usage: ag <<--index-full|--index-new|--delete|--reindex|--info> <--list listname>> <[--file|--msgid|--hash] <maildir/file/hash/messageid>> [options]" @@ -93,6 +94,10 @@ op = OptionParser.new do |opts| opts.on('--readonly', 'Do not alter the maildir in any way') do $options.readonly = true end + + opts.on('--jobs', 'Number of parallel jobs to run (defaults to 75% of core count)') do |jobs| + $options.jobs = jobs + end end op.parse! @@ -110,6 +115,8 @@ $maildir.serializer = Maildir::Serializer::Mail.new $es = Elasticsearch::Client.new(log: false) $es.transport.reload_connections! +Ag::Utils.proc_count = $options.jobs + ############################################################################### def do_full |