lib/gooddata/bricks/middleware/gooddata_middleware.rb in gooddata-0.6.51 vs lib/gooddata/bricks/middleware/gooddata_middleware.rb in gooddata-0.6.52

- old
+ new

@@ -23,13 +23,19 @@ # Set logger logger = params['GDC_LOGGER'] GoodData.logger = logger + # Set parallelism + max_concurrency = params['max_concurrency'] || params['MAX_CONCURRENCY'] + if max_concurrency && max_concurrency.to_i > 0 + $pmap_default_thread_count = max_concurrency.to_i # rubocop:disable GlobalVars + end + # Connect Client - protocol = params['CLIENT_GDC_PROTOCOL'] || DEFAULT_PROTOCOL - hostname = params['CLIENT_GDC_HOSTNAME'] || DEFAULT_HOSTNAME + protocol = params['CLIENT_GDC_PROTOCOL'] || params['GDC_PROTOCOL'] || DEFAULT_PROTOCOL + hostname = params['CLIENT_GDC_HOSTNAME'] || params['GDC_HOSTNAME'] || DEFAULT_HOSTNAME server = "#{protocol}://#{hostname}" client = GoodDataMiddleware.connect( server, params['GDC_VERIFY_SSL'].to_b, params['GDC_USERNAME'], @@ -89,14 +95,17 @@ class << self def connect(server, verify_ssl, username, password, sst_token) # rubocop:disable Metrics/ParameterLists if username.nil? || password.nil? puts "Connecting with SST to server #{server}" raise 'SST (SuperSecureToken) not present in params' if sst_token.nil? - GoodData.connect(sst_token: sst_token, server: server, verify_ssl: verify_ssl) + conn = GoodData.connect(sst_token: sst_token, server: server, verify_ssl: verify_ssl) else puts "Connecting as #{username} to server #{server}" - GoodData.connect(username, password, server: server, verify_ssl: verify_ssl) + conn = GoodData.connect(username, password, server: server, verify_ssl: verify_ssl) end + conn.stats_on + + conn end end end end end