From f5ed5b4d825a474d945d4efe643f8d41db9c0fda Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sat, 7 Jan 2023 12:07:21 +0100 Subject: [PATCH] Explain cronjob random start time Co-authored-by: Simon MELLERIN --- scripts/_common.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 9395a7d..ba24150 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -15,7 +15,11 @@ pkg_dependencies="apt-transport-https postgresql postgresql-contrib php${YNH_PHP # Assign two variables: # minutes: random value between 00 and 59 (MM) # hour: random value between 0 and 2 -# It is used for the cronjob, so that it runs every 3 hours starting at 00:MM, 01:MM, or 02:MM. +# To avoid peak load on proxy.aeneria.com, we randomize when the cron job will be launched +# Assign two variables: +# minutes: random value between 00 and 59 (MM) +# hour: random value between 0 and 2 +# These two variables are used in conf/aeneria.cron so that it runs every 3 hours starting at 00:MM, 01:MM, or 02:MM. generate_random_minutes_hour () { minutes="$(ynh_string_random --length=1 --filter=0-5)$(ynh_string_random --length=1 --filter=0-9)" hour="$(ynh_string_random --length=1 --filter=0-2)"