[mood] Fix mood checkin sending
This commit is contained in:
@ -327,13 +327,11 @@ def send_stop_notifications_for_in_progress_scrobbles() -> int:
|
|||||||
|
|
||||||
|
|
||||||
def send_mood_checkin_reminders() -> 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
|
from profiles.models import UserProfile
|
||||||
|
|
||||||
now = timezone.now()
|
|
||||||
notifications_sent = 0
|
notifications_sent = 0
|
||||||
for profile in UserProfile.objects.filter(mood_checkin_enabled=True):
|
for profile in UserProfile.objects.filter(mood_checkin_enabled=True):
|
||||||
if profile.mood_checkin_frequency == "hourly" and now.minute == 0:
|
|
||||||
MoodNtfyNotification(profile).send()
|
MoodNtfyNotification(profile).send()
|
||||||
notifications_sent += 1
|
notifications_sent += 1
|
||||||
|
|
||||||
|
|||||||
@ -153,7 +153,7 @@ CELERY_BEAT_SCHEDULE = {
|
|||||||
},
|
},
|
||||||
"send-mood-checkin": {
|
"send-mood-checkin": {
|
||||||
"task": "scrobbles.tasks.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