fix Cron.PurgeExpiredActivitiesWorker
authorMaksim Pechnikov <parallel588@gmail.com>
Thu, 13 Aug 2020 18:01:21 +0000 (21:01 +0300)
committerMaksim Pechnikov <parallel588@gmail.com>
Thu, 13 Aug 2020 18:01:21 +0000 (21:01 +0300)
lib/pleroma/workers/cron/purge_expired_activities_worker.ex

index e926c5dc8e68a5624bf11d5cfdb165ff7eddef13..0de8edd245b8e938c6b829e11387b0acd8c21eae 100644 (file)
@@ -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