summaryrefslogtreecommitdiff
path: root/src/frontend.erl
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2015-10-01 15:09:33 +0200
committerMagnus Ahltorp <map@kth.se>2015-10-01 15:09:33 +0200
commit260e8e31f3b65bc758e05f441361f6afd415df3e (patch)
tree0b3bf96184023303fa5befd824a74e6a0db19cfc /src/frontend.erl
parent2933b44dd61e9e7e5be21690ddec05a2c6e21a6d (diff)
Added util:parallel_map and use it when checking entries.
Diffstat (limited to 'src/frontend.erl')
-rw-r--r--src/frontend.erl11
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),