Skip to content

Commit

Permalink
refactor: automatisation des management command (#849)
Browse files Browse the repository at this point in the history
## Description

🎸 utilisation d'un script `sh` générique pour la planification des
management commands
🎸 planification de la commande `clearsessions`

## Type de changement
🚧 technique

### Points d'attention

🦺 ajout du paramètre `set -ue` dans le script `sh`
  • Loading branch information
vincentporte authored Dec 5, 2024
1 parent 8a1cd3c commit 56dba3e
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 135 deletions.
18 changes: 0 additions & 18 deletions clevercloud/add_user_to_list_when_register.sh

This file was deleted.

18 changes: 0 additions & 18 deletions clevercloud/collect_daily_django_stats.sh

This file was deleted.

18 changes: 0 additions & 18 deletions clevercloud/collect_daily_matomo_stats.sh

This file was deleted.

18 changes: 0 additions & 18 deletions clevercloud/collect_monthly_matomo_stats.sh

This file was deleted.

18 changes: 0 additions & 18 deletions clevercloud/collect_weekly_matomo_forum_stats.sh

This file was deleted.

17 changes: 9 additions & 8 deletions clevercloud/cron.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[
"*/10 * * * * $ROOT/clevercloud/rebuild_index.sh",
"0 7 * * * $ROOT/clevercloud/collect_daily_matomo_stats.sh",
"5 7 * * * $ROOT/clevercloud/collect_daily_django_stats.sh",
"10 7 1 * * $ROOT/clevercloud/collect_monthly_matomo_stats.sh",
"15 7 * * 1 $ROOT/clevercloud/collect_weekly_matomo_forum_stats.sh",
"*/15 7-21 * * * $ROOT/clevercloud/send_notifications_regular.sh",
"20 6 * * * $ROOT/clevercloud/send_notifications_daily.sh",
"10 6-22 * * * $ROOT/clevercloud/add_user_to_list_when_register.sh",
"30 13 * * 1-5 $ROOT/clevercloud/send_notifs_on_unanswered_topics_list.sh"
"0 3 * * * $ROOT/clevercloud/run_management_command.sh clearsessions",
"0 7 * * * $ROOT/clevercloud/run_management_command.sh collect_matomo_stats",
"5 7 * * * $ROOT/clevercloud/run_management_command.sh collect_django_stats",
"10 7 1 * * $ROOT/clevercloud/run_management_command.sh collect_matomo_stats --period month",
"15 7 * * 1 $ROOT/clevercloud/run_management_command.sh collect_matomo_forum_stats",
"*/15 7-21 * * * $ROOT/clevercloud/run_management_command.sh send_messages_notifications asap",
"20 6 * * * $ROOT/clevercloud/run_management_command.sh send_messages_notifications day",
"10 6-22 * * * $ROOT/clevercloud/run_management_command.sh add_user_to_list_when_register",
"30 13 * * 1-5 $ROOT/clevercloud/run_management_command.sh send_notifs_on_unanswered_topics"
]
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash -l

set -ue

#
# About clever cloud cronjobs:
Expand All @@ -14,4 +15,4 @@ fi
# $APP_HOME is set by default by clever cloud.
cd $APP_HOME

python manage.py send_notifs_on_unanswered_topics
python manage.py "$@"
18 changes: 0 additions & 18 deletions clevercloud/send_notifications_daily.sh

This file was deleted.

18 changes: 0 additions & 18 deletions clevercloud/send_notifications_regular.sh

This file was deleted.

0 comments on commit 56dba3e

Please sign in to comment.