Commit 014f91c1 authored by feld's avatar feld
Browse files

Merge branch 'issue/2036-part-2' into 'develop'

[#2036] fixed cron worker

See merge request !2886
parents 14a06e63 9b055f72
Pipeline #29760 failed with stages
in 18 minutes and 24 seconds
......@@ -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
......@@ -37,9 +37,9 @@ def perform(_job) do
)
|> Repo.all()
|> send_emails
else
:ok
end
:ok
end
def send_emails(users) do
......
......@@ -55,11 +55,9 @@ def perform(_job) 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
......@@ -23,9 +23,9 @@ defmodule Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker do
def perform(_job) do
if Config.get([ActivityExpiration, :enabled]) do
Enum.each(ActivityExpiration.due_expirations(@interval), &delete_activity/1)
else
:ok
end
after
:ok
end
def delete_activity(%ActivityExpiration{activity_id: activity_id}) do
......@@ -41,7 +41,7 @@ def delete_activity(%ActivityExpiration{activity_id: activity_id}) 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
......
......@@ -12,5 +12,6 @@ defmodule Pleroma.Workers.Cron.StatsWorker do
@impl Oban.Worker
def perform(_job) do
Pleroma.Stats.do_collect()
:ok
end
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment