radiator 0.3.14 → 0.3.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/radiator/api.rb +14 -0
- data/lib/radiator/transaction.rb +6 -2
- data/lib/radiator/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2d13a99e9a18133d52e256663cd27bb52e77d15
|
4
|
+
data.tar.gz: 5e986442c8577f297c1636f41fcd849f199ade9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73fd7dc83bcf3426ff096ab659ecbfb7f7108b8db2572fa238d82bbf9d8cb88ec65bacd166adb772404370110030400dad8f9493cf2fba09efc962cdf947f972
|
7
|
+
data.tar.gz: f81a73d0a4e8cf45163b43b12126fa89e1d2ad6a094ad0a2b111b826bb6183300c08a045b2f1b2331a8a7aee99fccf66f9df30e7a1223bf1ba06a6eef7e8358a
|
data/Gemfile.lock
CHANGED
data/lib/radiator/api.rb
CHANGED
@@ -250,6 +250,8 @@ module Radiator
|
|
250
250
|
@api = nil
|
251
251
|
@block_api = nil
|
252
252
|
@backoff_at = nil
|
253
|
+
|
254
|
+
ObjectSpace.define_finalizer(self, self.class.finalize(@logger, @hashie_logger))
|
253
255
|
end
|
254
256
|
|
255
257
|
# Get a specific block or range of blocks.
|
@@ -801,5 +803,17 @@ module Radiator
|
|
801
803
|
@backoff_sleep = nil
|
802
804
|
end
|
803
805
|
end
|
806
|
+
|
807
|
+
def self.finalize(logger, hashie_logger)
|
808
|
+
proc {
|
809
|
+
if !!logger && defined?(logger.close) && !logger.closed?
|
810
|
+
logger.close
|
811
|
+
end
|
812
|
+
|
813
|
+
if !!hashie_logger && defined?(hashie_logger.close) && !hashie_logger.closed?
|
814
|
+
hashie_logger.close
|
815
|
+
end
|
816
|
+
}
|
817
|
+
end
|
804
818
|
end
|
805
819
|
end
|
data/lib/radiator/transaction.rb
CHANGED
@@ -58,7 +58,7 @@ module Radiator
|
|
58
58
|
@api = Api.new(options)
|
59
59
|
@network_broadcast_api = NetworkBroadcastApi.new(options)
|
60
60
|
|
61
|
-
ObjectSpace.define_finalizer(self, self.class.finalize(@api, @network_broadcast_api))
|
61
|
+
ObjectSpace.define_finalizer(self, self.class.finalize(@api, @network_broadcast_api, @logger))
|
62
62
|
end
|
63
63
|
|
64
64
|
def chain_id(chain_id = nil)
|
@@ -242,7 +242,7 @@ module Radiator
|
|
242
242
|
)
|
243
243
|
end
|
244
244
|
|
245
|
-
def self.finalize(api, network_broadcast_api)
|
245
|
+
def self.finalize(api, network_broadcast_api, logger)
|
246
246
|
proc {
|
247
247
|
if !!api && !api.stopped?
|
248
248
|
puts "DESTROY: #{api.inspect}" if ENV['LOG'] == 'TRACE'
|
@@ -255,6 +255,10 @@ module Radiator
|
|
255
255
|
network_broadcast_api.shutdown
|
256
256
|
network_broadcast_api = nil
|
257
257
|
end
|
258
|
+
|
259
|
+
if !!logger && defined?(logger.close) && !logger.closed?
|
260
|
+
logger.close
|
261
|
+
end
|
258
262
|
}
|
259
263
|
end
|
260
264
|
end
|
data/lib/radiator/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radiator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anthony Martin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|