mirror of
https://github.com/btdig/dhtcrawler2.git
synced 2025-02-23 21:59:04 +00:00
fix hash_download_cache startup bug
This commit is contained in:
parent
dcf0181839
commit
108a1bfd1b
@ -94,8 +94,12 @@ do_save(DBPool, Docs) ->
|
|||||||
try_load(DBPool, []) ->
|
try_load(DBPool, []) ->
|
||||||
?T("download_cache empty, load hash from db"),
|
?T("download_cache empty, load hash from db"),
|
||||||
Conn = mongo_pool:get(DBPool),
|
Conn = mongo_pool:get(DBPool),
|
||||||
{Doc} = hash_reader_common:load_delete_doc(Conn, ?HASH_DOWNLOAD_COLL),
|
case hash_reader_common:load_delete_doc(Conn, ?HASH_DOWNLOAD_COLL) of
|
||||||
{Doc, []};
|
{Doc} ->
|
||||||
|
{Doc, []};
|
||||||
|
{} ->
|
||||||
|
{{}, []}
|
||||||
|
end;
|
||||||
try_load(_, [First|Rest]) ->
|
try_load(_, [First|Rest]) ->
|
||||||
{First, Rest}.
|
{First, Rest}.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user