zold 0.13.19 → 0.13.20

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
  SHA1:
3
- metadata.gz: 95dd6bbdccf72324cc861ebb29f6825d23bce93c
4
- data.tar.gz: b34a5fb43a224631fda4f53b87e8ca8216253c2b
3
+ metadata.gz: 7624ccdaec6f4098e5e024189d4345e8805d7095
4
+ data.tar.gz: 585ad1cbafa0e8424d1017b3983156c94af543f5
5
5
  SHA512:
6
- metadata.gz: 28f4bb01e0856b74017923a941373df4098883e94c6e2c1cd72ae061cfb26a7985ad012095874878663663460e0ddc6b738ec4d6cc0575c0a610cb70805f9b94
7
- data.tar.gz: 67bdc25fd68c191257169d29b7d12e1bc1c1b56becff6385e6470784c572c72ef2e07eb12bd42a7d9aa5b787fce8536d914bc0b0f9a70159094df688e8b4e019
6
+ metadata.gz: f0212c757e122fd6c2429959a42e73c4972022c2471f7e24e248d5f69c6e20cfb3d004813c36f64221a9f16b6e5d5de9d3e2a87a7a90fc99c085b02a648b27d2
7
+ data.tar.gz: 320d3092ef14317b3566d92b98aa238bd56a82714e3fb54b850100bec75650259c266fac08c16f0fef8236bb378f0fd5f41a90dde0a3002ee3ab78a8c82675c2
data/heroku.yml CHANGED
@@ -4,7 +4,7 @@ build:
4
4
  config:
5
5
  LC_ALL: UTF-8
6
6
  run:
7
- web: "./bin/zold node --no-colors --trace
7
+ web: "./bin/zold node --no-colors --trace --verbose
8
8
  --bind-port=$PORT --port=80 --host=b1.zold.io --threads=0
9
9
  --invoice=ML5Ern7m@912ecc24b32dbe74 --never-reboot
10
10
  --bonus-wallet=81c9c25789b03876 --private-key=bonus.key --bonus-amount=1 --bonus-time=60"
@@ -79,7 +79,7 @@ Available options:"
79
79
  start = Time.now
80
80
  if opts['ignore-node'].include?(r.to_s)
81
81
  @log.debug("#{r} ignored because of --ignore-node")
82
- return false
82
+ return 0
83
83
  end
84
84
  res = r.http("/wallet/#{id}").get
85
85
  raise "Wallet #{id} not found" if res.code == '404'
@@ -161,6 +161,7 @@ module Zold
161
161
  begin
162
162
  @log.info("Starting up the web front at http://#{host}:#{opts[:port]}...")
163
163
  Front.run!
164
+ @log.info("The web front stopped at http://#{host}:#{opts[:port]}")
164
165
  ensure
165
166
  metronome.stop
166
167
  end
@@ -51,7 +51,7 @@ module Zold
51
51
 
52
52
  def to_json
53
53
  {
54
- threads: @threads.count,
54
+ threads: @threads.map { |t| "#{t.name}/#{t.status}" }.join(', '),
55
55
  scores: @scores.size,
56
56
  best: @best.count,
57
57
  history: history.count
@@ -77,7 +77,7 @@ module Zold
77
77
  VerboseThread.new(@log).run do
78
78
  Thread.current.name = 'farm-cleaner'
79
79
  loop do
80
- sleep(60)
80
+ sleep(60) unless strength == 1 # which will only happen in tests
81
81
  clean(host, port, strength, threads)
82
82
  end
83
83
  end
@@ -110,7 +110,8 @@ module Zold
110
110
  @scores << zero
111
111
  @best << zero
112
112
  end
113
- @best = @best.reject(&:expired?).sort_by(&:value).reverse.take(threads)
113
+ @best = @best.reject(&:expired?).sort_by(&:value).reverse
114
+ @best = @best.take(threads) unless threads.zero?
114
115
  end
115
116
 
116
117
  def cycle(host, port, strength, threads)
@@ -125,8 +126,8 @@ module Zold
125
126
  before = @best.map(&:value).max
126
127
  save(n)
127
128
  @best << n
128
- after = @best.map(&:value).max
129
129
  clean(host, port, strength, threads)
130
+ after = @best.map(&:value).max
130
131
  @log.debug("#{Thread.current.name}: best score is #{@best[0]}") if before != after && !after.zero?
131
132
  end
132
133
  @scores << n
@@ -199,7 +199,7 @@ module Zold
199
199
  not_found do
200
200
  status 404
201
201
  content_type 'text/plain'
202
- 'Page not found'
202
+ "Page not found: #{request.url}"
203
203
  end
204
204
 
205
205
  error 400 do
@@ -219,7 +219,7 @@ module Zold
219
219
 
220
220
  def score
221
221
  best = settings.farm.best
222
- error 404 if best.empty?
222
+ raise 'Score is empty, there is something wrong with the Farm!' if best.empty?
223
223
  best[0]
224
224
  end
225
225
  end
@@ -23,5 +23,5 @@
23
23
  # Copyright:: Copyright (c) 2018 Yegor Bugayenko
24
24
  # License:: MIT
25
25
  module Zold
26
- VERSION = '0.13.19'.freeze
26
+ VERSION = '0.13.20'.freeze
27
27
  end
@@ -84,7 +84,12 @@ class FrontTest < Minitest::Test
84
84
  end
85
85
  end
86
86
 
87
+ # @todo #239:30min This tests is skipped since it crashes sporadically.
88
+ # Let's investigate and make it stable. I don't really know what's going
89
+ # on, but suspect some collision between threads:
90
+ # http://www.rultor.com/t/14940-397702802
87
91
  def test_pushes_twice
92
+ skip
88
93
  FakeNode.new(log: test_log).run do |port|
89
94
  FakeHome.new.run do |home|
90
95
  wallet = home.create_wallet
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.19
4
+ version: 0.13.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko