diff options
| author | Magnus Ahltorp <map@kth.se> | 2015-10-01 15:09:33 +0200 |
|---|---|---|
| committer | Magnus Ahltorp <map@kth.se> | 2015-10-01 15:09:33 +0200 |
| commit | 260e8e31f3b65bc758e05f441361f6afd415df3e (patch) | |
| tree | 0b3bf96184023303fa5befd824a74e6a0db19cfc /src/frontend.erl | |
| parent | 2933b44dd61e9e7e5be21690ddec05a2c6e21a6d (diff) | |
Added util:parallel_map and use it when checking entries.
Diffstat (limited to 'src/frontend.erl')
| -rw-r--r-- | src/frontend.erl | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/frontend.erl b/src/frontend.erl index b7fa4b1..1055e5f 100644 --- a/src/frontend.erl +++ b/src/frontend.erl @@ -241,16 +241,17 @@ check_entries_int(Entries, Start, End) -> end, [], lists:zip(Entries, lists:seq(Start, End))). check_entries_noreverse(Entries, Start, End) -> - lists:foldl(fun ({Hash, Index}, Acc) -> - lager:info("checking entry ~p", [Index]), - case check_entry_noreverse(Hash, Index) of + Results = util:parallel_map(fun ({Hash, Index}) -> + check_entry_noreverse(Hash, Index) + end, lists:zip(Entries, lists:seq(Start, End)), 2), + lists:foldl(fun (Result, Acc) -> + case Result of ok -> - lager:info("entry ~p is correct", [Index]), Acc; Error -> [Error | Acc] end - end, [], lists:zip(Entries, lists:seq(Start, End))). + end, [], Results). entryhash_from_entry(Entry) -> {ok, {Module, Function}} = application:get_env(plop, entryhash_from_entry), |
