Browse Source

CLDC-3311 UPRN bulk upload efficiency improvements (#2317)

* Empty-Commit

* feat: stress testing efficiency improvements

* feat: revert initialisations

* refactor: lint
pull/2321/head
natdeanlewissoftwire 9 months ago committed by GitHub
parent
commit
d063e653f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      app/services/address_client.rb
  2. 2
      app/services/postcode_service.rb
  3. 2
      app/services/uprn_client.rb

2
app/services/address_client.rb

@ -30,7 +30,7 @@ private
client.use_ssl = true client.use_ssl = true
client.verify_mode = OpenSSL::SSL::VERIFY_PEER client.verify_mode = OpenSSL::SSL::VERIFY_PEER
client.max_retries = 3 client.max_retries = 3
client.read_timeout = 10 # seconds client.read_timeout = 30 # seconds
client client
end end

2
app/services/postcode_service.rb

@ -11,7 +11,7 @@ class PostcodeService
begin begin
# URI encoding only supports ASCII characters # URI encoding only supports ASCII characters
ascii_postcode = self.class.clean(postcode) ascii_postcode = self.class.clean(postcode)
Timeout.timeout(5) { postcode_lookup = @pio.lookup(ascii_postcode) } Timeout.timeout(30) { postcode_lookup = @pio.lookup(ascii_postcode) }
rescue Timeout::Error rescue Timeout::Error
Rails.logger.warn("Postcodes.io lookup timed out") Rails.logger.warn("Postcodes.io lookup timed out")
end end

2
app/services/uprn_client.rb

@ -30,7 +30,7 @@ private
client.use_ssl = true client.use_ssl = true
client.verify_mode = OpenSSL::SSL::VERIFY_PEER client.verify_mode = OpenSSL::SSL::VERIFY_PEER
client.max_retries = 3 client.max_retries = 3
client.read_timeout = 10 # seconds client.read_timeout = 30 # seconds
client client
end end

Loading…
Cancel
Save