diff options
author | Alex Auvolat <alex@adnab.me> | 2018-09-25 21:21:20 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2018-09-25 21:29:03 +0200 |
commit | b8f0a5e8031877ccb29322eb9d7d56ffc69322f9 (patch) | |
tree | c9241549428cdaa3a8c51e5eeb6d68016015ecc7 /shard/lib | |
parent | 78e5caa664b860189ea86f95fe68ad5e6705897b (diff) | |
download | shard-b8f0a5e8031877ccb29322eb9d7d56ffc69322f9.tar.gz shard-b8f0a5e8031877ccb29322eb9d7d56ffc69322f9.zip |
oops
Diffstat (limited to 'shard/lib')
-rw-r--r-- | shard/lib/app/pagestore.ex | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/shard/lib/app/pagestore.ex b/shard/lib/app/pagestore.ex index 5f2ba54..9944544 100644 --- a/shard/lib/app/pagestore.ex +++ b/shard/lib/app/pagestore.ex @@ -124,7 +124,7 @@ defmodule SApp.PageStore do [{_, _, _}] -> true _ -> false end - if SData.bin_hash bin == hash and not already_have_it do + if SData.bin_hash(bin) == hash and not already_have_it do reqs = case state.reqs[hash] do nil -> state.reqs pids -> @@ -250,8 +250,10 @@ defmodule SApp.PageStore do def get(store, hash) do try do - bin = GenServer.call(store.pid, {:get, hash, store.prefer_ask}) - SData.term_unbin bin + case GenServer.call(store.pid, {:get, hash, store.prefer_ask}) do + nil -> nil + bin -> SData.term_unbin bin + end catch :exit, {:timeout, _} -> nil end |