miga-base 1.3.20.3 → 1.3.20.5

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: c6cd171c44ec3139121607db27badddcd12e8cefd45f49acc6bc5f018184943f
4
- data.tar.gz: 8ca59c51be7224fb7e0d3b0561cb72ef9f95594a2b51fa9a3c04c65ab60d7b66
3
+ metadata.gz: 17c8c736e04eeaea0e7247e7a5134a0902f4e2ed4c749d68e00b00aeeb7e7295
4
+ data.tar.gz: 93cca0af126920c07740be2a4f203d36f3632722022c5e09eda5d326469c31bc
5
5
  SHA512:
6
- metadata.gz: 281aa0434dbeb5d4d5c69e5df44a459e77d22ce1664c68553fe61c04640ec27128002428aaffca3f1913973d2cb689afba51e683f7e3ca594bfede38b1ad79be
7
- data.tar.gz: 2f37a8bc9fd5e516a669185b56e71339fca60314d7505917e1c4d4291801c81f4d9a3a36988e63bf0e0829d63046b3dc1b34c072a893449df2b63aa849cb1a05
6
+ metadata.gz: af8314535751804f3870767b4c0d88c5c139a3ae94e03c92317935397c5ee20a88e49ad97addcbf4be6e47947ee659a919db4ab1d60b48f86c5eda627fb3dba4
7
+ data.tar.gz: 65e3cdc46e3cf3d4f094b0dd6bfa93806ede628573eede6f893450720d76a8c5d69528c4b63cb6839861438014d6801297d0c8a70c0d4f841a79118d54aab2cf
@@ -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,8 @@ 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.tmp", 'w') { |fh| Marshal.dump(dist, fh) }
155
+ File.rename("#{file}.marshal.tmp", "#{file}.marshal")
138
156
  end
139
157
  cli.say
140
158
 
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, 5].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.5
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