diff options
author | Alex Auvolat <alex@adnab.me> | 2018-09-11 15:39:09 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2018-09-11 15:39:09 +0200 |
commit | a033c82a3c656a8f53feb60b5b149680771ac247 (patch) | |
tree | bc3cb9a6954aebcfd1a0c5f61d367e1083802c3e /shard/lib/app/blockstore.ex | |
parent | e92969db3f0a2093da16eb7db18c9db49225a719 (diff) | |
download | shard-a033c82a3c656a8f53feb60b5b149680771ac247.tar.gz shard-a033c82a3c656a8f53feb60b5b149680771ac247.zip |
Use DETS to store shard & peer list to disk
Diffstat (limited to 'shard/lib/app/blockstore.ex')
-rw-r--r-- | shard/lib/app/blockstore.ex | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/shard/lib/app/blockstore.ex b/shard/lib/app/blockstore.ex index 8e4fddc..5e93135 100644 --- a/shard/lib/app/blockstore.ex +++ b/shard/lib/app/blockstore.ex @@ -109,10 +109,10 @@ defmodule SApp.BlockStore do end def ask_random_peers(state, key) do - peers = :ets.lookup(:shard_peer_db, state.shard_id) + peers = Shard.Manager.get_shard_peers(state.shard_id) |> Enum.shuffle |> Enum.take(3) - for {_, peer} <- peers do + for peer <- peers do Shard.Manager.send(peer, {state.shard_id, state.path, {:get, key}}) end end |