miga-base 1.3.20.3 → 1.3.20.4

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: c6cd171c44ec3139121607db27badddcd12e8cefd45f49acc6bc5f018184943f
4
- data.tar.gz: 8ca59c51be7224fb7e0d3b0561cb72ef9f95594a2b51fa9a3c04c65ab60d7b66
3
+ metadata.gz: c11dfa7c37bbfd12ff0b9d71c3760489a685f048e1692c9c608b38726d91af36
4
+ data.tar.gz: 7d6db500aa13fd518a0b702b205d592c9af218ecb9c26d6c78cb25ef41d88e9a
5
5
  SHA512:
6
- metadata.gz: 281aa0434dbeb5d4d5c69e5df44a459e77d22ce1664c68553fe61c04640ec27128002428aaffca3f1913973d2cb689afba51e683f7e3ca594bfede38b1ad79be
7
- data.tar.gz: 2f37a8bc9fd5e516a669185b56e71339fca60314d7505917e1c4d4291801c81f4d9a3a36988e63bf0e0829d63046b3dc1b34c072a893449df2b63aa849cb1a05
6
+ metadata.gz: 808778c7f3e3264ccbd5b45251cebd81a12e7dd91328e0bfed8e1d3aa27376e6d610f3f0ae6f3e80b11549d85ec2499fdb9d69a1e4776435ad3b1fafb3985d0d
7
+ data.tar.gz: e68bb859e5dd6f6568b712e23cdd125486dd911ed0ce63b2046cdad921f1f1fe39e23f3b4980f3b9c1352404ca68d6989b8fa8a7613bdf01f21b8224a9d969a0
@@ -77,8 +77,15 @@ module MiGA::Cli::Action::Doctor::Distances
77
77
  def partial_bidir_tmp(project, ref_ds)
78
78
  n = ref_ds.size
79
79
 
80
- # Read data first (threaded)
80
+ # Check first if a previous run is complete (and recover it)
81
81
  tmp = File.join(project.path, 'doctor-bidirectional.tmp')
82
+ tmp_done = File.join(tmp, 'done.txt')
83
+ if File.size?(tmp_done) &&
84
+ File.readlines(tmp_done)[0].chomp.to_i == cli[:threads]
85
+ return tmp
86
+ end
87
+
88
+ # Read data first (threaded)
82
89
  FileUtils.mkdir_p(tmp)
83
90
  MiGA::Parallel.process(cli[:threads]) do |thr|
84
91
  file = File.join(tmp, "#{thr}.json")
@@ -102,6 +109,8 @@ module MiGA::Cli::Action::Doctor::Distances
102
109
  end
103
110
  end
104
111
 
112
+ # Save information to indicate that the run is complete and return
113
+ File.open(tmp_done, 'w') { |fh| fh.puts cli[:threads] }
105
114
  return tmp
106
115
  end
107
116
 
@@ -113,7 +122,14 @@ module MiGA::Cli::Action::Doctor::Distances
113
122
  dist = { aai: {}, ani: {} }
114
123
  cli[:threads].times do |i|
115
124
  cli.advance('Merging:', i + 1, cli[:threads], false)
125
+
126
+ next if File.size?(File.join(tmp, "#{i+1}.json.marshal"))
116
127
  file = File.join(tmp, "#{i}.json")
128
+ if File.size?("#{file}.marshal")
129
+ dist = Marshal.load(File.read("#{file}.marshal"))
130
+ next
131
+ end
132
+
117
133
  File.open(file, 'r') do |fh|
118
134
  metric = nil
119
135
  fh.each do |ln|
@@ -135,6 +151,7 @@ module MiGA::Cli::Action::Doctor::Distances
135
151
  end
136
152
  raise "Incomplete thread dump: #{file}" unless metric == :end
137
153
  end
154
+ File.open("#{file}.marshal", 'w') { |fh| Marshal.dump(dist, fh) }
138
155
  end
139
156
  cli.say
140
157
 
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, 3].freeze
15
+ VERSION = [1.3, 20, 4].freeze
16
16
 
17
17
  ##
18
18
  # Nickname for the current major.minor version.
@@ -20,7 +20,7 @@ module MiGA
20
20
 
21
21
  ##
22
22
  # Date of the current gem relese.
23
- VERSION_DATE = Date.new(2024, 8, 29)
23
+ VERSION_DATE = Date.new(2024, 9, 1)
24
24
 
25
25
  ##
26
26
  # References of MiGA
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miga-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.20.3
4
+ version: 1.3.20.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis M. Rodriguez-R
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-29 00:00:00.000000000 Z
11
+ date: 2024-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: daemons