fix hash_reader stop working bug

This commit is contained in:
Kevin Lynx 2013-07-09 15:08:01 +08:00
parent 5a1be24b89
commit 5d8c198357
2 changed files with 2 additions and 1 deletions

View File

@ -39,7 +39,7 @@ srv_name() ->
init([File, Fun]) ->
FullPath = in_priv_path(File),
State = case file:consult(FullPath) of
{error, Reason} ->
{error, _Reason} ->
Config = if Fun == nil -> []; true -> Fun() end,
file:write_file(FullPath, io_lib:fwrite("~p.\n",[Config])),
Config;

View File

@ -106,6 +106,7 @@ handle_cast({process_hash, Doc, DownloadDoc}, State) ->
true ->
?T(?FMT("inc_announce success ~s", [ListHash])),
on_updated(Conn),
if DownloadDoc -> try_next_download(Conn); true -> ok end,
State;
false ->
?T(?FMT("start to download the torrent ~s", [ListHash])),