With photos more than 4MB, I have this error.
Closed this issue · 3 comments
emmtte commented
D:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:146:in `rescue in rbuf_fill': Timeout:
:Error (Timeout::Error)
from D:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:140:in `rbuf_fill'
from D:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:122:in `readuntil'
from D:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:132:in `readline'
from D:/Ruby193/lib/ruby/1.9.1/net/http.rb:2562:in `read_status_line'
from D:/Ruby193/lib/ruby/1.9.1/net/http.rb:2551:in `read_new'
from D:/Ruby193/lib/ruby/1.9.1/net/http.rb:1319:in `block in transport_r
equest'
from D:/Ruby193/lib/ruby/1.9.1/net/http.rb:1316:in `catch'
from D:/Ruby193/lib/ruby/1.9.1/net/http.rb:1316:in `transport_request'
from D:/Ruby193/lib/ruby/1.9.1/net/http.rb:1293:in `request'
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/flickraw-0.9.6/lib/flickraw/oau
th.rb:153:in `block in post'
from D:/Ruby193/lib/ruby/1.9.1/net/http.rb:745:in `start'
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/flickraw-0.9.6/lib/flickraw/oau
th.rb:147:in `post'
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/flickraw-0.9.6/lib/flickraw/oau
th.rb:96:in `post_multipart'
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/flickraw-0.9.6/lib/flickraw/api
.rb:138:in `upload_flickr'
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/flickraw-0.9.6/lib/flickraw/api
.rb:90:in `upload_photo'
emmtte commented
It's working now, I just add this on my code before upload to flickr
require 'net/http'
# Lengthen timeout in Net::HTTP
module Net
class HTTP
alias old_initialize initialize
def initialize(*args)
old_initialize(*args)
@read_timeout = 5*60 # 5 minutes
end
end
end
Lem commented
Can you please edit/repost the code used in your last comment? Can't read the code in this format. Maybe 'GitHub Flavored Markdown' with ```ruby is better
emmtte commented
Done, sorry I'm a beginner.