Add more logging to send_activity_recap_worker

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
chapril
Thomas Citharel 7 months ago
parent ab622cb424
commit c05243f839
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
  1. 2
      lib/service/notifier/email.ex
  2. 4
      lib/service/workers/send_activity_recap_worker.ex

@ -178,7 +178,7 @@ defmodule Mobilizon.Service.Notifier.Email do
@spec save_last_notification_time(User.t()) :: {:ok, Setting.t()} | {:error, Ecto.Changeset.t()}
defp save_last_notification_time(%User{id: user_id, email: email}) do
Logger.debug("Saving last notification time for user #{email}")
Logger.info("Saving last notification time for user #{email}")
attrs = %{user_id: user_id, last_notification_sent: DateTime.utc_now()}
case Users.get_setting(user_id) do

@ -42,6 +42,10 @@ defmodule Mobilizon.Service.Workers.SendActivityRecapWorker do
%User{settings: %Setting{group_notifications: group_notifications}} =
user
} ->
Logger.info(
"Asking to send email notification #{group_notifications} to user #{user.email} for #{length(activities)} activities"
)
Email.send(user, activities, recap: group_notifications)
end)
end,

Loading…
Cancel
Save