zold 0.11.2 → 0.11.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/zold/commands/merge.rb +4 -4
- data/lib/zold/node/entrance.rb +2 -1
- data/lib/zold/version.rb +1 -1
- 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: 5f2635ac65d327c6ef19ec965976a6de7961fce5
|
4
|
+
data.tar.gz: 9a5cb6ef5aab7e9217a0131eac7fa422a95fb559
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/zold/commands/merge.rb
CHANGED
@@ -50,8 +50,7 @@ Available options:"
|
|
50
50
|
mine = @wallets.all if mine.empty?
|
51
51
|
modified = []
|
52
52
|
mine.each do |id|
|
53
|
-
|
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(
|
65
|
-
raise "There are no remote copies of #{
|
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])
|
data/lib/zold/node/entrance.rb
CHANGED
@@ -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
|
-
|
55
|
+
@pool.post do
|
55
56
|
push_sync(id, body)
|
56
57
|
end
|
57
58
|
end
|
data/lib/zold/version.rb
CHANGED