miga-base 1.3.20.9 → 1.3.20.10

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
  SHA256:
3
- metadata.gz: 1fc1b49c630d4e619c3394850d15b692cab359f617970ce6f3235e8f6c373d6c
4
- data.tar.gz: 2c2c6bb6ee77b873993a6ecea24047ca854acd31e88a43ee9588c350df0a719b
3
+ metadata.gz: 89f86ec82f63d08729e4f970919dba5762a2888c797cdf6a8a7f32805929508c
4
+ data.tar.gz: cb3e930ba1a4acb776bd7bcc7481470363109c2c01a67e1780f1d71dc29659c0
5
5
  SHA512:
6
- metadata.gz: 86a62582ae62601a5c3e3935b5bae8046e97a19b53624827d20a8728066ec68360664042a213ee094346e7dba63d8765a044cbc413bcafc3bd8f841579371c1f
7
- data.tar.gz: 7ad47d39abd7c257c23b8bdf825135a51dd8e9fa2c96cc14881a16e5a8e03264d9541381796616462c8e6bf3b4a85cfd5ff0528539447e2f3e487aceafa6bb48
6
+ metadata.gz: aa6434515aaca67b727e2a725cd2013e3096eb638cfc590e452c4e33c0e72f4c788b14cc0e8254cb91f14082330c038fa826ecab2cca01ccc2d4f96272ce0bac
7
+ data.tar.gz: f5aec44b327725934d7585e157a68a653c9567743c46120e90d5280638935194684829acaa0003ff14ed239ee07ead6a604e25d423743986f627cb379767614c
data/lib/miga/version.rb CHANGED
@@ -12,7 +12,7 @@ module MiGA
12
12
  # - String indicating release status:
13
13
  # - rc* release candidate, not released as gem
14
14
  # - [0-9]+ stable release, released as gem
15
- VERSION = [1.3, 20, 9].freeze
15
+ VERSION = [1.3, 20, 10].freeze
16
16
 
17
17
  ##
18
18
  # Nickname for the current major.minor version.
@@ -1,30 +1,18 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'thread'
4
3
  require 'miga'
5
4
 
6
5
  ARGV[1] or abort "Usage: #{$0} path/to/project threads"
7
6
 
8
7
  p = MiGA::Project.load(ARGV[0])
9
- dsn = p.dataset_names
10
- thr = ARGV[1].to_i
8
+ thr = [ARGV[1].to_i, 1].max
11
9
 
12
- m = MiGA::MiGA.new
13
- m.say 'Cleaning Databases'
10
+ p.say 'Cleaning Databases'
11
+ ds = p.dataset_ref_active
14
12
 
15
- (0..thr - 1).each do |t|
16
- fork do
17
- dsn.each_with_index do |i, idx|
18
- m.advance('Dataset:', idx + 1, dsn.size) if t == 0
19
- next unless (idx % thr) == t
20
-
21
- d = p.dataset(i)
22
- next unless d.ref? && d.active?
23
-
24
- d.cleanup_distances!
25
- end
26
- end
13
+ MiGA::Parallel.distribute(ds, thr) do |d, k, t|
14
+ p.advance('Dataset:', k, ds.size) if t == 0
15
+ d.cleanup_distances!
27
16
  end
28
- Process.waitall
29
- m.advance('Dataset:', dsn.size, dsn.size)
30
- m.say
17
+ p.advance('Dataset:', ds.size, ds.size)
18
+ p.say
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miga-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.20.9
4
+ version: 1.3.20.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis M. Rodriguez-R