From: Mark Felder Date: Sat, 8 Aug 2020 17:49:02 +0000 (-0500) Subject: Limit expirations for each cron execution to 50. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=e08ea01d09c67a93801aa05d33bad0eb24dfca8b;p=akkoma Limit expirations for each cron execution to 50. This should prevent servers from being crushed. 50/min is a pretty good rate. --- 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