Fix refreshing groups

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2020-11-20 10:43:50 +01:00
parent 3eacbb2ca3
commit 19c9cf5e16
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -100,11 +100,7 @@ defmodule Mobilizon.Federation.ActivityPub.Refresher do
def refresh_all_external_groups do
Repo.transaction(fn ->
Actors.list_external_groups_for_stream()
|> Stream.map(fn %Actor{id: group_id, url: group_url} ->
{group_url, Actors.get_single_group_member_actor(group_id)}
end)
|> Stream.filter(fn {_group_url, member_actor} -> not is_nil(member_actor) end)
|> Stream.map(fn {group_url, member_actor} -> fetch_group(group_url, member_actor) end)
|> Stream.map(&refresh_profile/1)
|> Stream.run()
end)
end