lib/cdnconnect_api.rb in cdnconnect-api-0.3.0 vs lib/cdnconnect_api.rb in cdnconnect-api-0.3.1

- old
+ new

@@ -24,11 +24,11 @@ ## # Used to easily interact with CDN Connect API. class APIClient @@application_name = 'cdnconnect-api-ruby' - @@application_version = '0.3.0' + @@application_version = '0.3.1' @@user_agent = @@application_name + ' v' + @@application_version @@api_host = 'https://api.cdnconnect.com' @@api_version = 'v1' ## @@ -248,10 +248,13 @@ @logger.error(upload_response.body) # put the upload url back in the list # of prefetched urls so it can be reused set_prefetched_upload_url(destination_path, upload_url) + + # take a breath + sleep 1.5 else # successful upload, clear out the active upload queue # and remove uploaded files from the upload queue successful_upload_attempt(destination_path) @@ -607,9 +610,11 @@ elsif i > 2 @logger.error("Too many get_upload_url attempts") return response end @logger.error(response.body) + # take a breath + sleep 1.5 i += 1 end while i <= 3 end