From e08ea01d09c67a93801aa05d33bad0eb24dfca8b Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Sat, 8 Aug 2020 12:49:02 -0500 Subject: [PATCH] Limit expirations for each cron execution to 50. This should prevent servers from being crushed. 50/min is a pretty good rate. --- lib/pleroma/activity_expiration.ex | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pleroma/activity_expiration.ex b/lib/pleroma/activity_expiration.ex index 7cc9668b3..84edf68ef 100644 --- a/lib/pleroma/activity_expiration.ex +++ b/lib/pleroma/activity_expiration.ex @@ -46,6 +46,7 @@ defmodule Pleroma.ActivityExpiration do ActivityExpiration |> where([exp], exp.scheduled_at < ^naive_datetime) + |> limit(50) |> Repo.all() end -- 2.45.2