Browse Source

Added connect timeouts to MongoDB

Andrew Kane 8 năm trước cách đây
mục cha
commit
8c854b23ea
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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