From e70b21ae79f27587f2b26f4b26e59df2a0ec2c34 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 2 Mar 2021 14:48:59 +0100 Subject: [PATCH] Only refresh groups that need updating Signed-off-by: Thomas Citharel --- lib/federation/activity_pub/refresher.ex | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/federation/activity_pub/refresher.ex b/lib/federation/activity_pub/refresher.ex index 0aee6d6e6..57f67ba09 100644 --- a/lib/federation/activity_pub/refresher.ex +++ b/lib/federation/activity_pub/refresher.ex @@ -100,6 +100,7 @@ defmodule Mobilizon.Federation.ActivityPub.Refresher do def refresh_all_external_groups do Repo.transaction(fn -> Actors.list_external_groups_for_stream() + |> Stream.filter(&Actors.needs_update?/1) |> Stream.map(&refresh_profile/1) |> Stream.run() end)