我使用名为 auto_html 的 gem 嵌入了 soundcloud URL。我的网站时不时地随机崩溃,出现一个错误,这似乎是由于 soundcloud 上的流量过多而导致的超时请求?有没有办法在请求超时并重新加载页面时忽略嵌入文件的代码行?
错误:
JSON::ParserError
ActionView::Template::Error (757: unexpected token at '<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
We were unable to process your request in time - SoundCloud
Yikes, we were unable to process your request in time.
Please reload the page or try again in a moment.
视图中要忽略的代码:
41: <% if micropost.url.include? 'soundcloud' %>
42: <%= auto_html(micropost.url) {soundcloud} %>
43: <% end %>