zold 0.16.3 → 0.16.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 +4 -4
- data/lib/zold/node/front.rb +12 -5
- data/lib/zold/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6878147c3eac159d72548009bed74eda692af6b465f82ae47c2fd071de818512
|
|
4
|
+
data.tar.gz: 42401944fc5709a6fb6ea30de6f4af5ebc789538ca87ed204c0386792fbd3011
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 97e5df269652087a17d29b3b603cc6b26992e189ce7005cb944ede9559884fdd8d0c1c60bb0463dd5a4dc267f1d6f57c9ad867864b98b679b8fce3431da4a6df
|
|
7
|
+
data.tar.gz: 52ac1e64157997658b5b4be0230960ca61099b4aabdbab7ba43faefd69d4b948a5a4b4a4e0d123c8a0e92915a362aeb63ee333a37a98e4f559f8916231aafacb
|
data/lib/zold/node/front.rb
CHANGED
|
@@ -129,7 +129,10 @@ while #{settings.address} is in '#{settings.network}'")
|
|
|
129
129
|
headers[Http::SCORE_HEADER] = score.reduced(16).to_s
|
|
130
130
|
headers['X-Zold-Thread'] = Thread.current.object_id.to_s
|
|
131
131
|
unless @start.nil?
|
|
132
|
-
|
|
132
|
+
if Time.now - @start > 1
|
|
133
|
+
settings.log.info("Slow response to #{request.request_method} #{request.url} \
|
|
134
|
+
in #{Age.new(@start, limit: 1)}")
|
|
135
|
+
end
|
|
133
136
|
headers['X-Zold-Milliseconds'] = ((Time.now - @start) * 1000).round.to_s
|
|
134
137
|
end
|
|
135
138
|
end
|
|
@@ -191,7 +194,7 @@ while #{settings.address} is in '#{settings.network}'")
|
|
|
191
194
|
platform: RUBY_PLATFORM,
|
|
192
195
|
load: Cachy.cache(:a_load, expires_in: 5 * 60) { Usagewatch.uw_load.to_f },
|
|
193
196
|
threads: "#{Thread.list.select { |t| t.status == 'run' }.count}/#{Thread.list.count}",
|
|
194
|
-
wallets:
|
|
197
|
+
wallets: total_wallets,
|
|
195
198
|
remotes: settings.remotes.all.count,
|
|
196
199
|
nscore: settings.remotes.all.map { |r| r[:score] }.inject(&:+) || 0,
|
|
197
200
|
farm: settings.farm.to_json,
|
|
@@ -213,7 +216,7 @@ while #{settings.address} is in '#{settings.network}'")
|
|
|
213
216
|
protocol: settings.protocol,
|
|
214
217
|
id: wallet.id.to_s,
|
|
215
218
|
score: score.to_h,
|
|
216
|
-
wallets:
|
|
219
|
+
wallets: total_wallets,
|
|
217
220
|
mtime: wallet.mtime.utc.iso8601,
|
|
218
221
|
size: File.size(wallet.path),
|
|
219
222
|
digest: wallet.digest,
|
|
@@ -235,7 +238,7 @@ while #{settings.address} is in '#{settings.network}'")
|
|
|
235
238
|
protocol: settings.protocol,
|
|
236
239
|
id: wallet.id.to_s,
|
|
237
240
|
score: score.to_h,
|
|
238
|
-
wallets:
|
|
241
|
+
wallets: total_wallets,
|
|
239
242
|
key: wallet.key.to_pub,
|
|
240
243
|
mtime: wallet.mtime.utc.iso8601,
|
|
241
244
|
digest: wallet.digest,
|
|
@@ -355,7 +358,7 @@ while #{settings.address} is in '#{settings.network}'")
|
|
|
355
358
|
version: settings.version,
|
|
356
359
|
alias: settings.node_alias,
|
|
357
360
|
score: score.to_h,
|
|
358
|
-
wallets:
|
|
361
|
+
wallets: total_wallets
|
|
359
362
|
)
|
|
360
363
|
end
|
|
361
364
|
|
|
@@ -424,6 +427,10 @@ while #{settings.address} is in '#{settings.network}'")
|
|
|
424
427
|
yield header
|
|
425
428
|
end
|
|
426
429
|
|
|
430
|
+
def total_wallets
|
|
431
|
+
Cachy.cache(:a_wallets, expires_in: 5 * 60) { settings.wallets.all.count }
|
|
432
|
+
end
|
|
433
|
+
|
|
427
434
|
def score
|
|
428
435
|
best = Cachy.cache(:a_score, expires_in: 60) { settings.farm.best }
|
|
429
436
|
raise 'Score is empty, there is something wrong with the Farm!' if best.empty?
|
data/lib/zold/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zold
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.16.
|
|
4
|
+
version: 0.16.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yegor Bugayenko
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-10-
|
|
11
|
+
date: 2018-10-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: backtrace
|