configurable lifetime for ephemeral activities

This commit is contained in:
Alexander Strizhakov 2020-09-07 20:57:38 +03:00 committed by rinpatch
commit 2c2094d4b2
5 changed files with 26 additions and 6 deletions

View file

@ -77,6 +77,7 @@ defmodule Pleroma.Workers.PurgeExpiredActivity do
def expires_late_enough?(scheduled_at) do
now = DateTime.utc_now()
diff = DateTime.diff(scheduled_at, now, :millisecond)
diff > :timer.hours(1)
min_lifetime = Pleroma.Config.get([__MODULE__, :min_lifetime], 600)
diff > :timer.seconds(min_lifetime)
end
end