Skip to content

Commit

Permalink
Create 'tenders_update_status_to_rejected' script and add it to cron
Browse files Browse the repository at this point in the history
  • Loading branch information
chloend committed Dec 24, 2024
1 parent c0b8f1a commit 4945473
Show file tree
Hide file tree
Showing 2 changed files with 24 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 @@ -20,5 +20,6 @@
"35 8 * * * $ROOT/clevercloud/tenders_send_siae_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",
"*/5 8-15 * * 1-5 $ROOT/clevercloud/tenders_send_validated.sh"
"*/5 8-15 * * 1-5 $ROOT/clevercloud/tenders_send_validated.sh",
"0 23 * * * $ROOT/clevercloud/tenders_update_status_to_rejected.sh"
]
22 changes: 22 additions & 0 deletions clevercloud/tenders_update_status_to_rejected.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash -l

# Update Tenders' status to rejected if no changes whitin 10 days since modification request

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

# About clever cloud cronjobs:
# https://developers.clever-cloud.com/doc/administrate/cron/

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 update_tender_status_to_rejected

0 comments on commit 4945473

Please sign in to comment.