From 4ff499b96c4e57489d829889a79f3401c41f5147 Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Mon, 21 Aug 2023 12:59:53 +0200 Subject: [PATCH] Add to cron --- clevercloud/cron.json | 1 + ...nd_author_transactioned_question_emails.sh | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100755 clevercloud/tenders_send_author_transactioned_question_emails.sh diff --git a/clevercloud/cron.json b/clevercloud/cron.json index 4aa0e01a9..3f84829f3 100644 --- a/clevercloud/cron.json +++ b/clevercloud/cron.json @@ -9,6 +9,7 @@ "40 7 * * 1 $ROOT/clevercloud/siaes_update_api_zrr_fields.sh", "0 7 * * 2 $ROOT/clevercloud/siaes_send_completion_reminder_emails.sh", "0 8 * * * $ROOT/clevercloud/siaes_send_user_request_reminder_emails.sh", + "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" diff --git a/clevercloud/tenders_send_author_transactioned_question_emails.sh b/clevercloud/tenders_send_author_transactioned_question_emails.sh new file mode 100755 index 000000000..335122779 --- /dev/null +++ b/clevercloud/tenders_send_author_transactioned_question_emails.sh @@ -0,0 +1,22 @@ +#!/bin/bash -l + +# Send email for tender transactioned question to author + +# Do not run if this env var is not set: +if [[ -z "$CRON_SEND_TENDER_AUTHOR_TRANSACTIONED_QUESTION_ENABLED" ]]; then + echo "CRON_SEND_TENDER_AUTHOR_TRANSACTIONED_QUESTION_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_author_transactioned_question_emails