1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-23 00:14:48 +00:00

Only refresh groups that need updating

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-03-02 14:48:59 +01:00
parent 74e0e009d1
commit e70b21ae79
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -100,6 +100,7 @@ defmodule Mobilizon.Federation.ActivityPub.Refresher do
def refresh_all_external_groups do def refresh_all_external_groups do
Repo.transaction(fn -> Repo.transaction(fn ->
Actors.list_external_groups_for_stream() Actors.list_external_groups_for_stream()
|> Stream.filter(&Actors.needs_update?/1)
|> Stream.map(&refresh_profile/1) |> Stream.map(&refresh_profile/1)
|> Stream.run() |> Stream.run()
end) end)