ruby rest-client: make it never timeout?

后端 未结 6 1279
温柔的废话
温柔的废话 2021-02-12 21:34

I am trying to use ruby rest-client to upload a large number of images to a site that I\'m writing. My code looks like:

RestClient.post url, :timeout => 9000         


        
6条回答
  •  后悔当初
    2021-02-12 22:05

    I'm having similar issues. A quick dive into the source reveals this bit of unfriendliness:

    def self.post(url, payload, headers={}, &block)
      Request.execute(:method => :post, :url => url, :payload => payload, :headers => headers, &block)
    end
    

    Unless I'm missing something, the timeout options aren't passed on to the underlying request. Time for a patch ...

提交回复
热议问题