Skip to content

Commit

Permalink
Add cron
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Dec 1, 2023
1 parent 6be2f87 commit f73a3fd
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clevercloud/cron.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
"30 8 * * * $ROOT/clevercloud/tenders_send_author_transactioned_question_emails.sh",
"0 9 * * * $ROOT/clevercloud/tenders_send_siae_contacted_reminder_emails.sh",
"10 9 * * * $ROOT/clevercloud/tenders_send_siae_interested_reminder_emails.sh",
"20 9 * * * $ROOT/clevercloud/tenders_send_author_incremental.sh"
"20 9 * * * $ROOT/clevercloud/tenders_send_author_incremental.sh",
"*/5 9-17 * * 1-5 $ROOT/clevercloud/tenders_send_validated.sh"
]
22 changes: 22 additions & 0 deletions clevercloud/tenders_send_validated.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash -l

# Send Tenders who are validated but not sent

# Do not run if this env var is not set:
if [[ -z "$CRON_TENDER_SEND_VALIDATED_ENABLED" ]]; then
echo "CRON_TENDER_SEND_VALIDATED_ENABLED not set. Exiting..."
exit 0
fi

# 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

django-admin send_validated_tenders
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ class Command(BaseCommand):
"""
Command to send validated tenders
Note: run via a CRON
"*/5 9-17 * * 1-5" = Every 5 minutes from 9am through 5pm on Monday through Friday
https://cron.help/#*/5_9-17_*_*_1-5
Usage: python manage.py send_validated_tenders
"""

Expand Down

0 comments on commit f73a3fd

Please sign in to comment.