From 5d8c198357be24274968cb23d50eecb60db40e6e Mon Sep 17 00:00:00 2001 From: Kevin Lynx Date: Tue, 9 Jul 2013 15:08:01 +0800 Subject: [PATCH] fix hash_reader stop working bug --- src/common/config.erl | 2 +- src/hash_reader/db_hash_reader.erl | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/config.erl b/src/common/config.erl index 9d0b2cf..7a7ba84 100644 --- a/src/common/config.erl +++ b/src/common/config.erl @@ -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; diff --git a/src/hash_reader/db_hash_reader.erl b/src/hash_reader/db_hash_reader.erl index ef6454d..29ad020 100644 --- a/src/hash_reader/db_hash_reader.erl +++ b/src/hash_reader/db_hash_reader.erl @@ -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])),