From 1d961e7570048c77909d40a58e66b37ae61dd82e Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Mon, 23 Mar 2020 08:54:22 +0100 Subject: [PATCH] support import options in prefix rake tasks. #389 --- lib/tasks/client_prefix.rake | 2 +- lib/tasks/prefix.rake | 2 +- lib/tasks/provider_prefix.rake | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/tasks/client_prefix.rake b/lib/tasks/client_prefix.rake index 679b6a185..e17bbd26c 100644 --- a/lib/tasks/client_prefix.rake +++ b/lib/tasks/client_prefix.rake @@ -48,7 +48,7 @@ namespace :client_prefix do desc 'Import all client_prefixes' task :import => :environment do - ClientPrefix.import(index: ClientPrefix.inactive_index) + ClientPrefix.import(index: ENV["INDEX"] || ClientPrefix.inactive_index, batch_size: (ENV["BATCH_SIZE"] || 100).to_i) end desc 'Generate uid' diff --git a/lib/tasks/prefix.rake b/lib/tasks/prefix.rake index 855173efa..060b6aa95 100644 --- a/lib/tasks/prefix.rake +++ b/lib/tasks/prefix.rake @@ -48,7 +48,7 @@ namespace :prefix do desc 'Import all prefixes' task :import => :environment do - Prefix.import(index: Prefix.inactive_index) + Prefix.import(index: ENV["INDEX"] || Prefix.inactive_index, batch_size: (ENV["BATCH_SIZE"] || 100).to_i) end desc 'Delete prefix and associated DOIs' diff --git a/lib/tasks/provider_prefix.rake b/lib/tasks/provider_prefix.rake index d04028c07..14bfcadf8 100644 --- a/lib/tasks/provider_prefix.rake +++ b/lib/tasks/provider_prefix.rake @@ -48,7 +48,7 @@ namespace :provider_prefix do desc 'Import all provider_prefixes' task :import => :environment do - ProviderPrefix.import(index: ProviderPrefix.inactive_index) + ProviderPrefix.import(index: ENV["INDEX"] || ProviderPrefix.inactive_index, batch_size: (ENV["BATCH_SIZE"] || 100).to_i) end desc 'Generate uid'