0

Ruby 経由で Mongo に接続するときに、タイムアウト値を設定する必要があります。Mongo 2.2 を使用しています。

またはを使用する必要があります:timeout:connect_timeout?SO と他の場所で両方のオプションを使用したコード スニペットが表示されます。違いはなんですか?

4

1 に答える 1

0

ここで、さまざまなタイムアウトが何であるかを確認できます。

https://github.com/mongodb/mongo-ruby-driver/blob/master/lib/mongo/mongo_client.rb#L104

そこからコピー:

#  @option opts [Float] :timeout (5.0) When all of the self.connections a pool are checked out,
#    this is the number of seconds to wait for a new connection to be released before throwing an exception.
#    Note: this setting is relevant only for multi-threaded applications.
#  @option opts [Float] :op_timeout (nil) The number of seconds to wait for a read operation to time out.
#    Disabled by default.
#  @option opts [Float] :connect_timeout (nil) The number of seconds to wait before timing out a
#    connection attempt.
于 2013-06-17T19:32:03.430 に答える