我在 Mongoid 中有很多超时错误。该错误表示它发生在connectable.rb#16
. 我找到了这个https://github.com/mongoid/moped/blob/master/lib/moped/sockets/connectable.rb#L16的来源
或者这里也是
https://github.com/mongoid/moped/blob/master/lib/moped/sockets/connectable.rb#L45 https://github.com/mongoid/moped/blob/master/lib/moped/sockets/connectable .rb#L60
那么我与该错误有什么关系,如何提高超时以消除该错误?
PS这是一个 sinatra 应用程序,这里是其中一个的堆栈跟踪。
Timeout::Error at /
execution expired
file: connectable.rb location: write line: 60
/var/lib/gems/1.9.1/gems/moped-1.3.2/lib/moped/sockets/connectable.rb 60 in write
handle_socket_errors { super }
/var/lib/gems/1.9.1/gems/moped-1.3.2/lib/moped/sockets/connectable.rb 60 in block in write
handle_socket_errors { super }
/var/lib/gems/1.9.1/gems/moped-1.3.2/lib/moped/sockets/connectable.rb 78 in handle_socket_errors
yield
/var/lib/gems/1.9.1/gems/moped-1.3.2/lib/moped/sockets/connectable.rb 60 in write
handle_socket_errors { super }
/var/lib/gems/1.9.1/gems/moped-1.3.2/lib/moped/connection.rb 156 in block in write
socket.write(buf)
/var/lib/gems/1.9.1/gems/moped-1.3.2/lib/moped/connection.rb 202 in with_connection
yield @sock