end
end
- defp after_supervisor_start() do
+ defp after_supervisor_start do
with digest_config <- Application.get_env(:pleroma, :email_notifications)[:digest],
true <- digest_config[:active],
%Crontab.CronExpression{} = schedule <-
# alias Pleroma.User
- def run() do
+ def run do
Logger.warn("Running digester")
config = Application.get_env(:pleroma, :email_notifications)[:digest]
negative_interval = -Map.fetch!(config, :interval)
now = NaiveDateTime.truncate(NaiveDateTime.utc_now(), :second)
from(u in inactive_users_query,
- where: fragment("? #> '{\"email_notifications\",\"digest\"}' @> 'true'", u.info),
+ where: fragment(~s(? #> '{"email_notifications","digest"}' @> 'true'), u.info),
where: u.last_digest_emailed_at < datetime_add(^now, ^negative_interval, "day"),
select: u
)
defmodule Pleroma.Web.Mailer.SubscriptionController do
use Pleroma.Web, :controller
- alias Pleroma.{JWT, Repo, User}
+ alias Pleroma.JWT
+ alias Pleroma.Repo
+ alias Pleroma.User
def unsubscribe(conn, %{"token" => encoded_token}) do
with {:ok, token} <- Base.decode64(encoded_token),
elixir: "~> 1.7",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
- # elixirc_options: [warnings_as_errors: true],
+ elixirc_options: [warnings_as_errors: true],
xref: [exclude: [:eldap]],
start_permanent: Mix.env() == :prod,
aliases: aliases(),
recent_notifications_ids =
user2
|> Notification.for_user_since(
- NaiveDateTime.add(NaiveDateTime.utc_now(), -5 * 86400, :second)
+ NaiveDateTime.add(NaiveDateTime.utc_now(), -5 * 86_400, :second)
)
|> Enum.map(& &1.id)