mirror of
https://github.com/btdig/dhtcrawler2.git
synced 2025-01-31 18:41:37 +00:00
fix hash_reader stop working bug
This commit is contained in:
parent
5a1be24b89
commit
5d8c198357
@ -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;
|
||||
|
@ -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])),
|
||||
|
Loading…
Reference in New Issue
Block a user