aboutsummaryrefslogtreecommitdiff
path: root/shard/lib/app/file.ex
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2018-11-06 11:57:09 +0100
committerAlex Auvolat <alex@adnab.me>2018-11-06 11:57:09 +0100
commitc4f6cbab20b0b1d08755073d93365e5bd00dc755 (patch)
tree384dd05c59a810d503790a2af1b5c49e1aed5ccf /shard/lib/app/file.ex
parent0e5b82f3348508eb7f4291a08722522a49edd752 (diff)
downloadshard-c4f6cbab20b0b1d08755073d93365e5bd00dc755.tar.gz
shard-c4f6cbab20b0b1d08755073d93365e5bd00dc755.zip
Shard deletion ; update README and TODO
Diffstat (limited to 'shard/lib/app/file.ex')
-rw-r--r--shard/lib/app/file.ex6
1 files changed, 6 insertions, 0 deletions
diff --git a/shard/lib/app/file.ex b/shard/lib/app/file.ex
index ce28beb..e2a9798 100644
--- a/shard/lib/app/file.ex
+++ b/shard/lib/app/file.ex
@@ -84,6 +84,12 @@ defmodule SApp.File do
{:reply, state.manifest, state}
end
+ def handle_call(:delete_shard, _from, state) do
+ GenServer.call(state.store, :delete_store)
+ File.rm(state.path)
+ {:stop, :normal, :ok, state}
+ end
+
def handle_call(:get_info, _from, state) do
reply = cond do
state.info != nil and GenServer.call(state.store, {:have_rec, state.info.merkle_root}) ->