From 3515cb5c3ac138c3e19eacc8fd78bb1480e3a98c Mon Sep 17 00:00:00 2001 From: Maksim Pechnikov Date: Thu, 13 Aug 2020 21:01:21 +0300 Subject: [PATCH] fix Cron.PurgeExpiredActivitiesWorker --- .../workers/cron/purge_expired_activities_worker.ex | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/pleroma/workers/cron/purge_expired_activities_worker.ex b/lib/pleroma/workers/cron/purge_expired_activities_worker.ex index e926c5dc8..0de8edd24 100644 --- a/lib/pleroma/workers/cron/purge_expired_activities_worker.ex +++ b/lib/pleroma/workers/cron/purge_expired_activities_worker.ex @@ -21,11 +21,12 @@ defmodule Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker do @impl Oban.Worker def perform(_job) do - if Config.get([ActivityExpiration, :enabled]) do - Enum.each(ActivityExpiration.due_expirations(@interval), &delete_activity/1) - else - :ok - end + if Config.get([ActivityExpiration, :enabled]) do + Enum.each(ActivityExpiration.due_expirations(@interval), &delete_activity/1) + end + + after + :ok end def delete_activity(%ActivityExpiration{activity_id: activity_id}) do @@ -41,7 +42,7 @@ defmodule Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker do {:user, _} -> Logger.error( - "#{__MODULE__} Couldn't delete expired activity: not found actorof ##{activity_id}" + "#{__MODULE__} Couldn't delete expired activity: not found actor of ##{activity_id}" ) end end -- 2.45.2