mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-27 00:09:35 +00:00
fix cron wroker
This commit is contained in:
parent
3515cb5c3a
commit
9b055f7211
|
@ -16,8 +16,8 @@ defmodule Pleroma.Workers.Cron.ClearOauthTokenWorker do
|
||||||
def perform(_job) do
|
def perform(_job) do
|
||||||
if Config.get([:oauth2, :clean_expired_tokens], false) do
|
if Config.get([:oauth2, :clean_expired_tokens], false) do
|
||||||
Token.delete_expired_tokens()
|
Token.delete_expired_tokens()
|
||||||
else
|
|
||||||
:ok
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
:ok
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -37,9 +37,9 @@ defmodule Pleroma.Workers.Cron.DigestEmailsWorker do
|
||||||
)
|
)
|
||||||
|> Repo.all()
|
|> Repo.all()
|
||||||
|> send_emails
|
|> send_emails
|
||||||
else
|
|
||||||
:ok
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
:ok
|
||||||
end
|
end
|
||||||
|
|
||||||
def send_emails(users) do
|
def send_emails(users) do
|
||||||
|
|
|
@ -55,11 +55,9 @@ defmodule Pleroma.Workers.Cron.NewUsersDigestWorker do
|
||||||
|> Repo.all()
|
|> Repo.all()
|
||||||
|> Enum.map(&Pleroma.Emails.NewUsersDigestEmail.new_users(&1, users_and_statuses))
|
|> Enum.map(&Pleroma.Emails.NewUsersDigestEmail.new_users(&1, users_and_statuses))
|
||||||
|> Enum.each(&Pleroma.Emails.Mailer.deliver/1)
|
|> Enum.each(&Pleroma.Emails.Mailer.deliver/1)
|
||||||
else
|
|
||||||
:ok
|
|
||||||
end
|
end
|
||||||
else
|
|
||||||
:ok
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
:ok
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -21,10 +21,9 @@ defmodule Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker do
|
||||||
|
|
||||||
@impl Oban.Worker
|
@impl Oban.Worker
|
||||||
def perform(_job) do
|
def perform(_job) do
|
||||||
if Config.get([ActivityExpiration, :enabled]) do
|
if Config.get([ActivityExpiration, :enabled]) do
|
||||||
Enum.each(ActivityExpiration.due_expirations(@interval), &delete_activity/1)
|
Enum.each(ActivityExpiration.due_expirations(@interval), &delete_activity/1)
|
||||||
end
|
end
|
||||||
|
|
||||||
after
|
after
|
||||||
:ok
|
:ok
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,5 +12,6 @@ defmodule Pleroma.Workers.Cron.StatsWorker do
|
||||||
@impl Oban.Worker
|
@impl Oban.Worker
|
||||||
def perform(_job) do
|
def perform(_job) do
|
||||||
Pleroma.Stats.do_collect()
|
Pleroma.Stats.do_collect()
|
||||||
|
:ok
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue