From c4f6cbab20b0b1d08755073d93365e5bd00dc755 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 6 Nov 2018 11:57:09 +0100 Subject: Shard deletion ; update README and TODO --- shard/lib/app/file.ex | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'shard/lib/app/file.ex') 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}) -> -- cgit v1.2.3