miga-base 1.3.20.8 → 1.3.20.9

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: 884fa2f8a10738f2de273cb19a10388f96c06bf60c0c1561a450c9a33baf92d8
4
- data.tar.gz: 93b494c3000517ff796380c3de3606066d6a853c170bbbbc7cb55a9dc1ed6e5a
3
+ metadata.gz: 1fc1b49c630d4e619c3394850d15b692cab359f617970ce6f3235e8f6c373d6c
4
+ data.tar.gz: 2c2c6bb6ee77b873993a6ecea24047ca854acd31e88a43ee9588c350df0a719b
5
5
  SHA512:
6
- metadata.gz: 366f03ddf1672c236d3378d9da097b363d608729f28eb30c1f4770702994b88959444f7a9ff058fda3999de1cd9df7d90320fd2314d42eac7dbbc1c5b2b9162f
7
- data.tar.gz: 58189a89c46f22c757b62e5d427f6b0fe89d80c692fda3a566aadc743a9e1ca991cfbe5d667af9ee1c05aebe3c6cc28f13ba71300609ad7a19f661b3a5d26e93
6
+ metadata.gz: 86a62582ae62601a5c3e3935b5bae8046e97a19b53624827d20a8728066ec68360664042a213ee094346e7dba63d8765a044cbc413bcafc3bd8f841579371c1f
7
+ data.tar.gz: 7ad47d39abd7c257c23b8bdf825135a51dd8e9fa2c96cc14881a16e5a8e03264d9541381796616462c8e6bf3b4a85cfd5ff0528539447e2f3e487aceafa6bb48
@@ -141,18 +141,22 @@ module MiGA::Cli::Action::Doctor::Distances
141
141
  end
142
142
  MiGA::Parallel.distribute(lower_triangle, cli[:threads]) do |cell, k, thr|
143
143
  cli.advance('Writing:', k, lower_triangle.size, false) if thr == 0
144
+ done_f = File.join(tmp, "#{cell[0]}-#{cell[1]}.txt")
145
+ next if File.exist?(done_f)
146
+
144
147
  fixed_ds = merge_bidir_tmp_pair(tmp, cell[0], cell[1])
145
- File.open(File.join(tmp, "#{cell[0]}-#{cell[1]}.txt"), 'w') do |fh|
146
- fixed_ds.each { |ds| fh.puts ds }
147
- end
148
+ File.open("#{done_f}.tmp", 'w') { |fh| fixed_ds.each { |ds| fh.puts ds } }
149
+ File.rename("#{done_f}.tmp", done_f)
148
150
  end
149
151
  cli.advance('Writing:', lower_triangle.size, lower_triangle.size, false)
150
152
  cli.say
151
153
  lower_triangle.map do |cell|
152
154
  Set.new.tap do |y|
153
- File.open(File.join(tmp, "#{cell[0]}-#{cell[1]}.txt"), 'r') do |fh|
154
- fh.each { |ln| y << ln.chomp }
155
- end
155
+ file = File.join(tmp, "#{cell[0]}-#{cell[1]}.txt")
156
+ raise MiGA::Error.new(
157
+ "Expected file missing, probably due to a thread failure: #{file}"
158
+ ) unless File.exist?(file)
159
+ File.open(file, 'r') { |fh| fh.each { |ln| y << ln.chomp } }
156
160
  end
157
161
  end.inject(Set.new, :+)
158
162
  end
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, 8].freeze
15
+ VERSION = [1.3, 20, 9].freeze
16
16
 
17
17
  ##
18
18
  # Nickname for the current major.minor version.
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.8
4
+ version: 1.3.20.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis M. Rodriguez-R