[5040:6784:0906/150930:FATAL:platform_canvas.cc(70)] SK_CRASH ] 55%
C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:146:in `rescue in rbuf_fill': Timeout::Error (Ti
meout::Error)
from letsmt_rr_filetype_uploader.rb:43:in `block in <main>'
from letsmt_rr_filetype_uploader.rb:39:in `each'
from letsmt_rr_filetype_uploader.rb:39:in `<main>'
这是文件上传进度的 rbuf-fill 超时错误。有没有什么不同的方法可以通过 * NOT * 使用 sleep来避免这种情况?
这是我用于文件上传的脚本:
puts "Tiek veikta atlasīto failu ielāde..."
progress = ProgressBar.create(:title => "Failu ielāde:", :progress_mark => "|", :format => "%t [%B] %p%%", :total => kolekcija.length)
kolekcija.each do |fails|
@fails = fails[0]
@b.div(:id, "pageHeader").link(:text, "Corpora").click
@b.span(:class => "btnText", :text => "Upload corpus").when_present.click
@b.text_field(:id, "corp_save_field_title").set("TestAuto #{File.basename(@fails)}") # Name / Title
@b.frame(:id, "uploadManagerFrame").frame(:index, 0).file_field(:id, "FileUploadHTML").set(@fails) # File absolute path
@b.frame(:id, "uploadManagerFrame").frame(:index, 0).span(:text, "Upload").click
@b.frame(:id, "uploadManagerFrame").table(:id, "ctrlGetUploadedFiles_gvUploadedFiles").wait_until_present
@b.frame(:id, "uploadManagerFrame").select_list(:id, "ctrlGetUploadedFiles_gvUploadedFiles_ctl02_ddlChooseType").option(:value, "#{fails[1]}").select
@b.send_keys :tab
if @b.frame(:id, "uploadManagerFrame").select_list(:id, "ctrlGetUploadedFiles_gvUploadedFiles_ctl02_ddlChooseLanguage").enabled?
@b.frame(:id, "uploadManagerFrame").select_list(:id, "ctrlGetUploadedFiles_gvUploadedFiles_ctl02_ddlChooseLanguage").select("English")
# @b.frame(:id, "uploadManagerFrame").select_list(:id, "ctrlGetUploadedFiles_gvUploadedFiles_ddlChooseLanguage_0").option(:value, "#{@filelang}".select
end
@b.send_keys :tab
@b.span(:class => "btnText", :text => "Save", :index => 1).when_present.click
@b.frame(:id, "uploadManagerFrame").table(:id, "ctrlGetUploadedFiles_gvUploadedFiles").wait_until_present
sleep 15
progress.increment
end