mongolly 0.2.15 → 0.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3180b1d4f7e69ae322065228bd937ab7cac50076
4
- data.tar.gz: ba33540a259e1e1994349dab03cf4adb1733b21e
3
+ metadata.gz: d4a4c808fbb0d280174a2463b7ba95858194d780
4
+ data.tar.gz: 5a79d742f2452dbcadd29c7772ba20d2b94b3d12
5
5
  SHA512:
6
- metadata.gz: 75c0f8ed48a9f55741aa8f10a51a607ab0b0b2dbf8d6a79e882276710a73f43788e930e0e70b309d72e5b32cede9d7d2bcacef3ddca88f7ac2152b1de5df6af1
7
- data.tar.gz: cfddccb10a833f934b13328788faa9aed1b4237cc51c3d41d4ee95de96442da59b6f69df44a89d7eaa4b68494105af11df64992bec5c696cc781f742adaa19a1
6
+ metadata.gz: 9fdc1841c794100970223ec25c648a9ffa373bc7b533affd8b92e7ab736af17b48f432e80bc075195e03c5f4d73aae1e842336aac88fcea119b6f379c64aa453
7
+ data.tar.gz: cbefa1bac1795c13a6a613430553595289e91c80ecaa053fbea384cdf2810cff4e2e8f44fd84ab8a9c567ca98f066e3fc22f2af8900bb896eff6c44d464fa565
@@ -170,7 +170,7 @@ class Mongo::MongoClient
170
170
  end
171
171
 
172
172
  def replica_set_connection(hosts, options)
173
- db = Mongo::MongoReplicaSetClient.new(hosts)
173
+ db = Mongo::MongoReplicaSetClient.new(hosts, op_timeout: @op_timeout)
174
174
  db["admin"].authenticate(options[:db_username], options[:db_password]) if options[:db_username]
175
175
  db
176
176
  end
@@ -9,6 +9,7 @@ module Mongolly
9
9
  @db_username = options[:db_username]
10
10
  @db_password = options[:db_password]
11
11
  @dry_run = options[:dry_run]
12
+ @op_timeout = options[:op_timeout] || "120"
12
13
  @logger = options[:logger] || Logger.new(STDOUT)
13
14
  @logger.level = case options[:log_level].strip
14
15
  when "fatal"; then Logger::FATAL
@@ -47,10 +48,10 @@ module Mongolly
47
48
  def connection
48
49
  db = if @database.is_a? Array
49
50
  @logger.debug "connecting to a replica set #{@database}"
50
- Mongo::MongoReplicaSetClient.new(@database)
51
+ Mongo::MongoReplicaSetClient.new(@database, op_timeout: @op_timeout)
51
52
  else
52
53
  @logger.debug "connecting to a single instance #{@database}"
53
- Mongo::MongoClient.new(*@database.split(":"))
54
+ Mongo::MongoClient.new(*@database.split(":"), op_timeout: @op_timeout)
54
55
  end
55
56
  if @db_username && @db_password
56
57
  db["admin"].authenticate(@db_username, @db_password)
@@ -1,3 +1,3 @@
1
1
  module Mongolly
2
- VERSION = "0.2.15".freeze
2
+ VERSION = "0.2.16".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongolly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.15
4
+ version: 0.2.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Saffitz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-24 00:00:00.000000000 Z
11
+ date: 2017-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor