aboutsummaryrefslogtreecommitdiff
path: root/shard/lib/app
diff options
context:
space:
mode:
Diffstat (limited to 'shard/lib/app')
-rw-r--r--shard/lib/app/pagestore.ex8
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