1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/aeneria_ynh.git synced 2024-09-03 18:06:15 +02:00

Explain cronjob random start time

Co-authored-by: Simon MELLERIN <simon.mellerin@ntymail.com>
This commit is contained in:
tituspijean 2023-01-07 12:07:21 +01:00 committed by GitHub
parent db13286b09
commit f5ed5b4d82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)"