[mood] Fix mood checkin sending
All checks were successful
build & deploy / test (push) Successful in 2m9s
build & deploy / build-and-deploy (push) Successful in 31s

This commit is contained in:
2026-05-22 12:13:09 -04:00
parent 4e059683b0
commit aeb460d677
2 changed files with 4 additions and 6 deletions

View File

@ -327,15 +327,13 @@ def send_stop_notifications_for_in_progress_scrobbles() -> int:
def send_mood_checkin_reminders() -> int:
"""Get all profiles with mood check-ins enabled and checkin!"""
"""Send mood check-in to every user with the setting enabled."""
from profiles.models import UserProfile
now = timezone.now()
notifications_sent = 0
for profile in UserProfile.objects.filter(mood_checkin_enabled=True):
if profile.mood_checkin_frequency == "hourly" and now.minute == 0:
MoodNtfyNotification(profile).send()
notifications_sent += 1
MoodNtfyNotification(profile).send()
notifications_sent += 1
return notifications_sent

View File

@ -153,7 +153,7 @@ CELERY_BEAT_SCHEDULE = {
},
"send-mood-checkin": {
"task": "scrobbles.tasks.send_mood_checkin",
"schedule": crontab(hour="*", minute=0),
"schedule": crontab(hour="*/4", minute=0),
},
}