record_store 3.1.1 → 3.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0c5d880e4a5ac28d3e0762906f50f1c80c7e379f
4
- data.tar.gz: 6cb4de217ff2b2dbc1c4d63420435014deaf2332
3
+ metadata.gz: 018df2d25b2395d0231937cc99f694bd53fd9e82
4
+ data.tar.gz: b9a42133108fadc3d16fe2ce9a55482acaf96089
5
5
  SHA512:
6
- metadata.gz: 34cead07f463106c10a2730d13ca6ae3010cfb76bdbe92c31a98a74d1702995b61437222db7cd3b6f3370f9ff1aaefd582d405de6c81320cc4c9530282fe26cd
7
- data.tar.gz: dc9cfc0dca5bd95cf7f0c58f5c1b6685c05108b97977bc04bb366b66cd6800ecff16bf8fe10f64c4e289ddd58ec0ff2ac1846ca2b713796ffe5a4a5365f25153
6
+ metadata.gz: 7cd6a4cae2e1a8b1db0019cb656b00f2e0eb56007e3ba3107c428e96ea865a1ad391d5d24808d066eb1490cad261a3a02e2c2f20b466284a2a19673326b3bd7d
7
+ data.tar.gz: 2605aa2f439c4c97012138830033c35d9e5dc274d8f9161b3ff6bb999d99b69f9382fcb595a194597e502e4de27353a9831e77065bc9783c8d9b49b040de6643
@@ -1,3 +1,3 @@
1
1
  module RecordStore
2
- VERSION = '3.1.1'
2
+ VERSION = '3.1.3'
3
3
  end
@@ -41,11 +41,23 @@ module RecordStore
41
41
  end
42
42
  end
43
43
 
44
- def modified
45
- modified_zones, mutex = [], Mutex.new
46
- self.all.map do |zone|
47
- thread = Thread.new do
48
- mutex.synchronize {modified_zones << zone} unless zone.unchanged?
44
+ MAX_PARALLEL_THREADS = 10
45
+ def modified(verbose: false)
46
+ modified_zones, mutex, zones = [], Mutex.new, self.all
47
+
48
+ (1..MAX_PARALLEL_THREADS).map do
49
+ Thread.new do
50
+ current_zone = nil
51
+ while not zones.empty?
52
+ mutex.synchronize { current_zone = zones.shift }
53
+ begin
54
+ mutex.synchronize { modified_zones << current_zone } unless current_zone.unchanged?
55
+ rescue Excon::Error::BadRequest => e
56
+ raise e unless e.response.body.include?('session already has a job')
57
+ puts "DynECT session collision for #{current_zone.name}" if verbose
58
+ mutex.synchronize { zones.push(current_zone) }
59
+ end
60
+ end
49
61
  end
50
62
  end.each(&:join)
51
63
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: record_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 3.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Willem van Bergen
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-10-30 00:00:00.000000000 Z
12
+ date: 2016-10-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor