fix cron wroker
authorMaksim Pechnikov <parallel588@gmail.com>
Thu, 13 Aug 2020 18:01:54 +0000 (21:01 +0300)
committerMaksim Pechnikov <parallel588@gmail.com>
Thu, 13 Aug 2020 18:03:15 +0000 (21:03 +0300)
lib/pleroma/workers/cron/clear_oauth_token_worker.ex
lib/pleroma/workers/cron/digest_emails_worker.ex
lib/pleroma/workers/cron/new_users_digest_worker.ex
lib/pleroma/workers/cron/purge_expired_activities_worker.ex
lib/pleroma/workers/cron/stats_worker.ex

index d41be4e87be28b19c1306b1bc349da51340368dd..276f47efc3e002cdc2825e0cff91985d9195cbd7 100644 (file)
@@ -16,8 +16,8 @@ defmodule Pleroma.Workers.Cron.ClearOauthTokenWorker do
   def perform(_job) do
     if Config.get([:oauth2, :clean_expired_tokens], false) do
       Token.delete_expired_tokens()
-    else
-      :ok
     end
+
+    :ok
   end
 end
index ee646229f22a727f538e427f89a305e224bab1cf..0c56f00fb4ec65d91fd9ad82c1499ba4ed1f18a5 100644 (file)
@@ -37,9 +37,9 @@ defmodule Pleroma.Workers.Cron.DigestEmailsWorker do
       )
       |> Repo.all()
       |> send_emails
-    else
-      :ok
     end
+
+    :ok
   end
 
   def send_emails(users) do
index abc8a5e954f066567a7e190f1c4bef4b90b8c061..8bbaed83d0cbdf19b10eb3f5ad153a924f0ce217 100644 (file)
@@ -55,11 +55,9 @@ defmodule Pleroma.Workers.Cron.NewUsersDigestWorker do
         |> Repo.all()
         |> Enum.map(&Pleroma.Emails.NewUsersDigestEmail.new_users(&1, users_and_statuses))
         |> Enum.each(&Pleroma.Emails.Mailer.deliver/1)
-      else
-        :ok
       end
-    else
-      :ok
     end
+
+    :ok
   end
 end
index 0de8edd245b8e938c6b829e11387b0acd8c21eae..6549207fc4273bffab886de69afe6845a63a2ae0 100644 (file)
@@ -21,10 +21,9 @@ 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)
-   end
-
+    if Config.get([ActivityExpiration, :enabled]) do
+      Enum.each(ActivityExpiration.due_expirations(@interval), &delete_activity/1)
+    end
   after
     :ok
   end
index e54bd9a7fc9700ae5dd73bb850f805bc9433d593..6a79540bc9d082a0bd6cc5fb5b561db56a69302c 100644 (file)
@@ -12,5 +12,6 @@ defmodule Pleroma.Workers.Cron.StatsWorker do
   @impl Oban.Worker
   def perform(_job) do
     Pleroma.Stats.do_collect()
+    :ok
   end
 end