diff options
author | Alex Auvolat <alex@adnab.me> | 2018-11-06 11:57:09 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2018-11-06 11:57:09 +0100 |
commit | c4f6cbab20b0b1d08755073d93365e5bd00dc755 (patch) | |
tree | 384dd05c59a810d503790a2af1b5c49e1aed5ccf /shard/lib/app/file.ex | |
parent | 0e5b82f3348508eb7f4291a08722522a49edd752 (diff) | |
download | shard-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.ex | 6 |
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}) -> |