rbbt-util 5.11.8 → 5.11.9
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 +4 -4
- data/lib/rbbt/persist.rb +4 -0
- data/lib/rbbt/tsv/parallel/traverse.rb +7 -10
- data/lib/rbbt/util/concurrency/processes/worker.rb +1 -1
- data/lib/rbbt/util/log.rb +2 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2dfad08e355d768565decb173f5a86198c3600e2
|
|
4
|
+
data.tar.gz: 64421ddf30a3066b1313c1762a9c1b41cb9a719b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f415797c4922dea7a9f3ecc8ff636cd3681da6f22b0111c34e1210e9beed4430c8c17c4787e9fe5ad4ad2e63d014be2308a533d220f87e2f40224b9d91daadaa
|
|
7
|
+
data.tar.gz: 8b7ad6d7440ece8580bab37f20c6e7e86158953a73dce168816b26e6003cb9966dd40359a798a0eb4abc152393c86c922f93ce3d2a27c272a47ebbbba5907d35
|
data/lib/rbbt/persist.rb
CHANGED
|
@@ -414,6 +414,7 @@ module Persist
|
|
|
414
414
|
begin
|
|
415
415
|
lockfile.unlock if lockfile.locked?
|
|
416
416
|
rescue
|
|
417
|
+
Log.exception $!
|
|
417
418
|
Log.warn "Lockfile exception: " << $!.message
|
|
418
419
|
end
|
|
419
420
|
end
|
|
@@ -421,6 +422,7 @@ module Persist
|
|
|
421
422
|
begin
|
|
422
423
|
lockfile.unlock if lockfile.locked?
|
|
423
424
|
rescue
|
|
425
|
+
Log.exception $!
|
|
424
426
|
Log.warn "Lockfile exception: " << $!.message
|
|
425
427
|
end
|
|
426
428
|
end
|
|
@@ -431,6 +433,7 @@ module Persist
|
|
|
431
433
|
begin
|
|
432
434
|
lockfile.unlock
|
|
433
435
|
rescue
|
|
436
|
+
Log.exception $!
|
|
434
437
|
Log.warn "Lockfile exception: " << $!.message
|
|
435
438
|
end
|
|
436
439
|
end
|
|
@@ -438,6 +441,7 @@ module Persist
|
|
|
438
441
|
begin
|
|
439
442
|
lockfile.unlock
|
|
440
443
|
rescue
|
|
444
|
+
Log.exception $!
|
|
441
445
|
Log.warn "Lockfile exception: " << $!.message
|
|
442
446
|
end
|
|
443
447
|
end
|
|
@@ -169,7 +169,7 @@ module TSV
|
|
|
169
169
|
v, mutex = nil, v if mutex.nil?
|
|
170
170
|
res = yield k, v, mutex
|
|
171
171
|
mutex.synchronize do
|
|
172
|
-
callback.call res
|
|
172
|
+
callback.call res
|
|
173
173
|
end
|
|
174
174
|
end
|
|
175
175
|
end
|
|
@@ -194,17 +194,13 @@ module TSV
|
|
|
194
194
|
q.callback &callback
|
|
195
195
|
q.init &block
|
|
196
196
|
|
|
197
|
-
|
|
198
|
-
#thread = Thread.new do
|
|
199
|
-
Misc.purge_pipes(q.queue.swrite)
|
|
197
|
+
thread = Thread.new do
|
|
200
198
|
traverse_obj(obj, options) do |*p|
|
|
201
199
|
q.process *p
|
|
202
200
|
end
|
|
203
201
|
end
|
|
204
202
|
|
|
205
|
-
|
|
206
|
-
Process.waitpid pid
|
|
207
|
-
raise "Traversal process ended with error status" unless $?.success?
|
|
203
|
+
thread.join
|
|
208
204
|
rescue Exception
|
|
209
205
|
Log.error "Exception traversing in cpus: #{$!.message}"
|
|
210
206
|
Log.exception $!
|
|
@@ -224,7 +220,7 @@ module TSV
|
|
|
224
220
|
begin
|
|
225
221
|
case store
|
|
226
222
|
when Hash
|
|
227
|
-
return if value.nil?
|
|
223
|
+
return false if value.nil?
|
|
228
224
|
if Hash === value
|
|
229
225
|
if TSV === store and store.type == :double
|
|
230
226
|
store.merge_zip value
|
|
@@ -236,15 +232,16 @@ module TSV
|
|
|
236
232
|
store[k] = v
|
|
237
233
|
end
|
|
238
234
|
when TSV::Dumper
|
|
239
|
-
return if value.nil?
|
|
235
|
+
return false if value.nil?
|
|
240
236
|
store.add *value
|
|
241
237
|
when IO
|
|
242
|
-
return if value.nil?
|
|
238
|
+
return false if value.nil?
|
|
243
239
|
value.strip!
|
|
244
240
|
store.puts value
|
|
245
241
|
else
|
|
246
242
|
store << value
|
|
247
243
|
end
|
|
244
|
+
true
|
|
248
245
|
rescue
|
|
249
246
|
raise "Error storing into #{store.inspect}: #{$!.message}"
|
|
250
247
|
end
|
data/lib/rbbt/util/log.rb
CHANGED