From 8a4691d711947a83e9155599e96c4173e655a8f3 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Fri, 29 Aug 2014 15:46:35 -0400 Subject: [PATCH] 3550: Improve startup time by removing excess api client instantiation. --- sdk/cli/bin/arv-run-pipeline-instance | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/sdk/cli/bin/arv-run-pipeline-instance b/sdk/cli/bin/arv-run-pipeline-instance index 101b4ee622..e9fe104387 100755 --- a/sdk/cli/bin/arv-run-pipeline-instance +++ b/sdk/cli/bin/arv-run-pipeline-instance @@ -59,8 +59,6 @@ class WhRunPipelineInstance end -$application_version = 1.0 - if RUBY_VERSION < '1.9.3' then abort <<-EOS #{$0.gsub(/^\.\//,'')} requires Ruby version 1.9.3 or higher. @@ -109,21 +107,6 @@ if $arvados_api_host.match /local/ suppress_warnings { OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE } end -class Google::APIClient - def discovery_document(api, version) - api = api.to_s - return @discovery_documents["#{api}:#{version}"] ||= - begin - response = self.execute!( - :http_method => :get, - :uri => self.discovery_uri(api, version), - :authenticated => false - ) - response.body.class == String ? JSON.parse(response.body) : response.body - end - end -end - # Parse command line options (the kind that control the behavior of # this program, that is, not the pipeline component parameters). @@ -214,13 +197,9 @@ end # Set up the API client. -$client ||= Google::APIClient. - new(:host => $arvados_api_host, - :application_name => File.split($0).last, - :application_version => $application_version.to_s) -$arvados = $client.discovered_api('arvados', $arvados_api_version) $arv = Arvados.new api_version: 'v1' - +$client = $arv.client +$arvados = $arv.arvados_api class PipelineInstance def self.find(uuid) -- 2.30.2