lib/pvoutput/client.rb
# Helper method to post batch request to pvoutput that retries at the moment we get
# a 400 error back with body containing 'Load in progress'
Helper method to post batch request to pvoutput that retries at the moment we get
a 400 error back with body containing 'Load in progress'
Helper method to post batch request to pvoutput that retries at the moment we get a 400 error back with body containing ' Load in progress '
def post_request(path, options = {}, &block)
      loop do
        response = self.class.post(path, options, &block)
        if response.code == 400 && response.body =~ /Load in progress/
          sleep(10)
        elsif response.code == 200
          return
        else
          raise("Bad Post: #{response.body}")
        end
      end
    end
def post_request ( path , options = { } , & block ) loop do response = self . class . post ( path , options , & block ) if response . code == 400 && response . body =~ / Load in progress / sleep ( 10 ) elsif response . code == 200 return else raise ( "Bad Post: #{response.body}" ) end end end
Helper method to post batch request to pvoutput that retries at the moment we get
a 400 error back with body containing 'Load in progress'
Helper method to post batch request to pvoutput that retries at the moment we get a 400 error back with body containing ' Load in progress '
# We can't send data too fast, when the previous request is still loaded we # have to wait so sleep 10 seconds and try again
path
<not_specific>
options
<not_specific>
block
<not_specific>