-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(notification): cronify task send_notifs_when_following_replies
- Loading branch information
1 parent
8429a29
commit ebddab5
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash -l | ||
|
||
# Collect Daily Matomo Stats | ||
|
||
# | ||
# About clever cloud cronjobs: | ||
# https://www.clever-cloud.com/doc/tools/crons/ | ||
# | ||
|
||
if [[ "$INSTANCE_NUMBER" != "0" ]]; then | ||
echo "Instance number is ${INSTANCE_NUMBER}. Stop here." | ||
exit 0 | ||
fi | ||
|
||
# $APP_HOME is set by default by clever cloud. | ||
cd $APP_HOME | ||
|
||
python manage.py send_notifs_when_following_replies |
11 changes: 11 additions & 0 deletions
11
lacommunaute/notification/management/commands/send_notifs_when_following_replies.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from django.core.management.base import BaseCommand | ||
|
||
from lacommunaute.notification.tasks import send_notifs_on_following_replies | ||
|
||
|
||
class Command(BaseCommand): | ||
help = "Envoyer une notification par email à l'auteur d'un sujet quand il y a de nouvelles réponses" | ||
|
||
def handle(self, *args, **options): | ||
send_notifs_on_following_replies() | ||
self.stdout.write(self.style.SUCCESS("That's all, folks!")) |