-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#29: Add background task for queue processing
- Loading branch information
1 parent
1b1fdfe
commit 540c568
Showing
4 changed files
with
63 additions
and
4 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
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,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
# | ||
# Simple background task that sends queued e-mails | ||
# - Does not interrupt on failure | ||
# - Controlled by supervisord, logs are grabbed by supervisor | ||
# - Shows logs on stdout and stderr | ||
# - Does not introduce additional dependencies on cron, exim and 60mb+ of others | ||
# | ||
|
||
cd /usr/src/taiga-back | ||
|
||
MAIL_NOTIFICATIONS_SEND_EVERY=${MAIL_NOTIFICATIONS_SEND_EVERY:-120} | ||
|
||
while true; do | ||
sleep ${MAIL_NOTIFICATIONS_SEND_EVERY} | ||
echo " >> Sending all queued mails" | ||
python manage.py send_notifications; exit_code=$? | ||
echo " >> Done, exit code is ${exit_code}" | ||
done |
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