Use tasks to process refreshing elements
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
386dbbb3a6
commit
fa99c09c57
|
@ -114,7 +114,10 @@ defmodule Mobilizon.Federation.ActivityPub.Refresher do
|
||||||
|
|
||||||
Logger.debug(inspect(items))
|
Logger.debug(inspect(items))
|
||||||
|
|
||||||
Enum.each(items, &handling_element/1)
|
items
|
||||||
|
|> Enum.map(fn item -> Task.async(fn -> handling_element(item) end) end)
|
||||||
|
|> Task.await_many()
|
||||||
|
|
||||||
Logger.debug("Finished processing a collection")
|
Logger.debug("Finished processing a collection")
|
||||||
:ok
|
:ok
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue