From b8f0a5e8031877ccb29322eb9d7d56ffc69322f9 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 25 Sep 2018 21:21:20 +0200 Subject: oops --- shard/lib/app/pagestore.ex | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'shard') 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 -- cgit v1.2.3