Fix Oban warnings
authorEgor Kislitsyn <egor@kislitsyn.com>
Tue, 26 May 2020 12:11:42 +0000 (16:11 +0400)
committerEgor Kislitsyn <egor@kislitsyn.com>
Tue, 26 May 2020 12:11:42 +0000 (16:11 +0400)
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

index 341eff054c17c93fcf8a2260de3681d73a30d214..a4c3b9516a0a7e54a9d0177b3b077c9c37e0a564 100644 (file)
@@ -16,6 +16,8 @@ defmodule Pleroma.Workers.Cron.ClearOauthTokenWorker do
   def perform(_opts, _job) do
     if Config.get([:oauth2, :clean_expired_tokens], false) do
       Token.delete_expired_tokens()
+    else
+      :ok
     end
   end
 end
index dd13c3b17f490f95892cc86187fe7ef10f806add..7f09ff3cf56a05ca043732e9ae333bb25c2c0115 100644 (file)
@@ -37,6 +37,8 @@ defmodule Pleroma.Workers.Cron.DigestEmailsWorker do
       )
       |> Repo.all()
       |> send_emails
+    else
+      :ok
     end
   end
 
index 9bd0a5621e04c2d5fba9e55351d2f7f48d78d71e..5c816b3fe3568aee3e67f1f1bd72dc454f917505 100644 (file)
@@ -55,7 +55,11 @@ 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
   end
 end
index b8953dd7fa858e78038a827ff4a12a2c588d2a77..84b3b84dea00d87a48d19d9d00fb073d28bfa593 100644 (file)
@@ -23,6 +23,8 @@ defmodule Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker do
   def perform(_opts, _job) do
     if Config.get([ActivityExpiration, :enabled]) do
       Enum.each(ActivityExpiration.due_expirations(@interval), &delete_activity/1)
+    else
+      :ok
     end
   end