mongolly 0.3.1 → 0.3.2

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
  SHA256:
3
- metadata.gz: 50c21716a1f00e3a327920da6efd15339c2bd90de8fd77e1a1fb1dc58b2a48bd
4
- data.tar.gz: a8d44b7a0cae0ae463d5433ceb9ccac6c9508b6af659fe8eca85b2bfea114610
3
+ metadata.gz: 0abe98091b5062bff7011a50781dfb5bda52e1af43dcd59cb29e636e6207c51c
4
+ data.tar.gz: c0e51721e6a635dddd021571dc957352d876c20e0ae80285a1f7a33d63a253ab
5
5
  SHA512:
6
- metadata.gz: 58bdb26a690ca200565950ee8d294cd527f7e23999bf121b660a8bb73aa6cbf316a553eac525fcc0fc63242281a51cb6d7dc6717f79a94a4a68144023a2391c1
7
- data.tar.gz: f9a841961bafee07b4b668273fc2193a79cae08c87a8f55f0675a669badc9c8bba2c57bded0d777206986db237e1a651b068f0b58b281b2bf7c1692007f2dbb8
6
+ metadata.gz: 9b08095ed01a2f14d1faf7106947c1f20bfec5e48a0c43f8742af5988361c3ddef8af8dbd83c49eb635df12c487a273e52bdd45ccc69b4795887e029f028af25
7
+ data.tar.gz: 61cd6485e435746e4fafea5ac4632b3eee7540a76e8c6c48b5dd6c9dd5fd675f8d9520d5ae9cf499cd0668114dbf1addf3140627ca5939d8cedc73498dd1c605
@@ -88,7 +88,9 @@ class Mongo::MongoClient
88
88
  end
89
89
 
90
90
  def with_disabled_balancing
91
- disable_balancing
91
+ balancer_disabled = self["config"].collection("settings").find_one(_id: "balancer")["stopped"]
92
+
93
+ disable_balancing unless balancer_disabled
92
94
  term_time = Time.now.utc + MAX_DISABLE_BALANCER_WAIT
93
95
  while !@mongolly_dry_run && (Time.now.utc < term_time) && balancer_active?
94
96
  @mongolly_logger.info "Balancer active, sleeping for 10s (#{(term_time - Time.now.utc).round}s remaining)"
@@ -100,7 +102,7 @@ class Mongo::MongoClient
100
102
  @mongolly_logger.debug "With shard balancing disabled..."
101
103
  yield
102
104
  ensure
103
- enable_balancing
105
+ enable_balancing unless balancer_disabled
104
106
  end
105
107
 
106
108
  def with_database_locked
@@ -1,3 +1,3 @@
1
1
  module Mongolly
2
- VERSION = "0.3.1".freeze
2
+ VERSION = "0.3.2".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.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Saffitz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-03 00:00:00.000000000 Z
11
+ date: 2018-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor