From c0804534ac323b1162d3d394eda6838f63e0a582 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 7 Nov 2018 15:14:22 +0100 Subject: Fixes thanks to Dialyzer --- shard/lib/app/file.ex | 4 ++-- shard/lib/app/pagestore.ex | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'shard/lib/app') diff --git a/shard/lib/app/file.ex b/shard/lib/app/file.ex index 7f03e1f..6c4a212 100644 --- a/shard/lib/app/file.ex +++ b/shard/lib/app/file.ex @@ -262,10 +262,10 @@ defmodule SApp.File do {k, []} end end - Logger.info("Missing pieces: #{map_size missing} / #{n_blocks}") + Logger.info("Missing pieces for #{state.id|>Base.encode16}: #{map_size missing} / #{n_blocks}") missing false -> - Logger.info("Incomplete Merkle tree meta data, requesting info from peers.") + Logger.info("Incomplete Merkle tree meta data for #{state.id|>Base.encode16}, requesting info from peers.") SApp.PageStore.set_roots(state.store, [state.info.merkle_root]) Process.send_after(self(), {:calc_missing, iter + 1}, iter * 1000) nil diff --git a/shard/lib/app/pagestore.ex b/shard/lib/app/pagestore.ex index 79d39b7..3f7fc0d 100644 --- a/shard/lib/app/pagestore.ex +++ b/shard/lib/app/pagestore.ex @@ -144,7 +144,7 @@ defmodule SApp.PageStore do end def handle_cast({:rec_pull, hash, ask_to}, state) do - if :dets.lookup state.store, hash == [] do + if :dets.lookup(state.store, hash) == [] do why = {:cached, System.os_time(:seconds) + @cache_ttl} init_rec_pull(state, hash, why, ask_to) end @@ -187,7 +187,7 @@ defmodule SApp.PageStore do end value = SData.term_unbin bin for dep <- SData.Page.refs value do - if :dets.lookup state.store, dep == [] do + if :dets.lookup(state.store, dep) == [] do init_rec_pull(state, dep, sub_why, [conn_pid]) end end -- cgit v1.2.3