zold 0.11.2 → 0.11.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c5af52af45ba9dfdd220e85af79232f92b919255
4
- data.tar.gz: '0880267133e607466adbadaa5d12ce8361ea7ab5'
3
+ metadata.gz: 5f2635ac65d327c6ef19ec965976a6de7961fce5
4
+ data.tar.gz: 9a5cb6ef5aab7e9217a0131eac7fa422a95fb559
5
5
  SHA512:
6
- metadata.gz: f94d22443de183a1b6e2be4cabe0880384efd1941adbf082b865f5cabe91d735def081a18a045550fea718a8e8bebe34dc51778c55702e62137bcea147c10d0e
7
- data.tar.gz: ccfcbbbc989f51cf00def91844f12ba763c66e9144990db8a43fddf17d7dac0a9c6b6391612cdb5bddf7a5938a441caa4d4e3ba1891bb4906d2b70a230d51e6c
6
+ metadata.gz: 3c6f1a464e2b81427cecb31ee26ed73ce8413635bc42156566b3927b214664ec3d862786880892102ecee5a94c10ce5e3c65d54d2ad85882d914dca603d0f58d
7
+ data.tar.gz: 57d24db630188ab12d0d23b3ec6aae112f94f79895b5092653f17d41f3352528d895cbe7ec227e7d014259a328f1aeb18cf978afbc8b9eb66cd39df6d477ddbb
data/README.md CHANGED
@@ -91,7 +91,7 @@ In order to do that just run (with your own wallet ID, of course,
91
91
  and your own public IP address instead of `4.4.4.4`):
92
92
 
93
93
  ```bash
94
- $ zold --trace --verbose --invoice=5f96e731e48ae21f --host=4.4.4.4
94
+ $ zold node --trace --verbose --invoice=5f96e731e48ae21f --host=4.4.4.4
95
95
  ```
96
96
 
97
97
  Then, open the page `4.4.4.4:4096` in your browser
@@ -102,7 +102,7 @@ Next, hit <kbd>Ctrl</kbd>+<kbd>c</kbd> and run it again, but instead
102
102
  of `zold` say `zold-nohup` and add an ampersand (`&`) at the end:
103
103
 
104
104
  ```bash
105
- $ zold-nohup --trace --verbose --invoice=5f96e731e48ae21f --host=4.4.4.4 &
105
+ $ zold-nohup node --trace --verbose --invoice=5f96e731e48ae21f --host=4.4.4.4 &
106
106
  ```
107
107
 
108
108
  Now you can close console, it will work in the background, saving the
@@ -50,8 +50,7 @@ Available options:"
50
50
  mine = @wallets.all if mine.empty?
51
51
  modified = []
52
52
  mine.each do |id|
53
- wallet = @wallets.find(Id.new(id))
54
- next unless merge(wallet, Copies.new(File.join(@copies, id)), opts)
53
+ next unless merge(Id.new(id), Copies.new(File.join(@copies, id)), opts)
55
54
  modified << Id.new(id)
56
55
  require_relative 'propagate'
57
56
  modified += Propagate.new(wallets: @wallets, log: @log).run(args)
@@ -61,8 +60,9 @@ Available options:"
61
60
 
62
61
  private
63
62
 
64
- def merge(wallet, cps, _)
65
- raise "There are no remote copies of #{wallet.id}, try FETCH first" if cps.all.empty?
63
+ def merge(id, cps, _)
64
+ raise "There are no remote copies of #{id}, try FETCH first" if cps.all.empty?
65
+ wallet = @wallets.find(id)
66
66
  cps = cps.all.sort_by { |c| c[:score] }.reverse
67
67
  patch = Patch.new
68
68
  main = Wallet.new(cps[0][:path])
@@ -44,6 +44,7 @@ module Zold
44
44
  @address = address
45
45
  @log = log
46
46
  @semaphores = Concurrent::Map.new
47
+ @pool = Concurrent::FixedThreadPool.new(16)
47
48
  end
48
49
 
49
50
  def push(id, body, sync: true)
@@ -51,7 +52,7 @@ module Zold
51
52
  if sync
52
53
  push_sync(id, body)
53
54
  else
54
- Thread.new do
55
+ @pool.post do
55
56
  push_sync(id, body)
56
57
  end
57
58
  end
data/lib/zold/version.rb CHANGED
@@ -23,5 +23,5 @@
23
23
  # Copyright:: Copyright (c) 2018 Yegor Bugayenko
24
24
  # License:: MIT
25
25
  module Zold
26
- VERSION = '0.11.2'.freeze
26
+ VERSION = '0.11.3'.freeze
27
27
  end
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.11.2
4
+ version: 0.11.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko