[mood] Fix mood checkin sending
This commit is contained in:
@ -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
|
||||
|
||||
|
||||
@ -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),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user