Explorar o código

Added connect timeouts to MongoDB

Andrew Kane %!s(int64=8) %!d(string=hai) anos
pai
achega
8c854b23ea
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      lib/blazer/adapters/mongodb_adapter.rb

+ 1 - 1
lib/blazer/adapters/mongodb_adapter.rb

@@ -28,7 +28,7 @@ module Blazer
       protected
 
       def client
-        @client ||= Mongo::Client.new(settings["url"])
+        @client ||= Mongo::Client.new(settings["url"], connect_timeout: 1, socket_timeout: 1, server_selection_timeout: 1)
       end
 
       def db