-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add sorting cronified tasks order test on frequency (nb of occurs in …
…a year) > hour > minute, PLUS reorder tasks in cron.json"
- Loading branch information
1 parent
5f725c6
commit 60b338e
Showing
2 changed files
with
24 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
[ | ||
"*/10 * * * * $ROOT/clevercloud/rebuild_index.sh", | ||
"*/15 7-21 * * * $ROOT/clevercloud/run_management_command.sh send_messages_notifications asap", | ||
"10 6-22 * * * $ROOT/clevercloud/run_management_command.sh add_user_to_list_when_register", | ||
"55 8-18 * * 1-5 $ROOT/clevercloud/run_management_command.sh add_missyou_notifications", | ||
"0 3 * * * $ROOT/clevercloud/run_management_command.sh clearsessions", | ||
"20 6 * * * $ROOT/clevercloud/run_management_command.sh send_messages_notifications day", | ||
"0 11 * * * $ROOT/clevercloud/run_management_command.sh collect_matomo_stats", | ||
"5 11 * * * $ROOT/clevercloud/run_management_command.sh collect_django_stats", | ||
"10 11 1 * * $ROOT/clevercloud/run_management_command.sh collect_matomo_stats --period month", | ||
"2 12 * * * $ROOT/clevercloud/run_management_command.sh datas_anonymisation", | ||
"30 13 * * 1-5 $ROOT/clevercloud/run_management_command.sh send_notifs_on_unanswered_topics", | ||
"15 11 * * 1 $ROOT/clevercloud/run_management_command.sh collect_matomo_forum_stats", | ||
"*/15 7-21 * * * $ROOT/clevercloud/run_management_command.sh send_messages_notifications asap", | ||
"55 8-18 * * 1-5 $ROOT/clevercloud/run_management_command.sh add_missyou_notifications", | ||
"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", | ||
"0 12 * * 1 $ROOT/clevercloud/run_management_command.sh delete_old_email_sent_tracks", | ||
"2 12 * * * $ROOT/clevercloud/run_management_command.sh datas_anonymisation", | ||
"30 13 * * 1-5 $ROOT/clevercloud/run_management_command.sh send_notifs_on_unanswered_topics" | ||
"10 11 1 * * $ROOT/clevercloud/run_management_command.sh collect_matomo_stats --period month" | ||
] |
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,17 @@ | ||
import json | ||
import pathlib | ||
|
||
from crontab import CronTab | ||
|
||
|
||
def test_crontab_order(settings): | ||
current_jobs = list( | ||
CronTab( | ||
tab="\n".join( | ||
json.loads(pathlib.Path(settings.ROOT_DIR).joinpath("clevercloud", "cron.json").read_bytes()) | ||
) | ||
) | ||
) | ||
ordered_jobs = sorted(current_jobs, key=lambda j: (-j.frequency(), j.hour.parts, j.minute.parts)) | ||
|
||
assert ordered_jobs == current_jobs |