Limit expirations for each cron execution to 50.

This should prevent servers from being crushed. 50/min is a pretty good rate.
This commit is contained in:
Mark Felder 2020-08-08 12:49:02 -05:00
parent 761cc5b4a2
commit e08ea01d09

View file

@ -46,6 +46,7 @@ def due_expirations(offset \\ 0) do
ActivityExpiration
|> where([exp], exp.scheduled_at < ^naive_datetime)
|> limit(50)
|> Repo.all()
end