From 5356ccc6cd138faa0f41fabaa5733bb94d9fb017 Mon Sep 17 00:00:00 2001 From: mmetc <92726601+mmetc@users.noreply.github.com> Date: Wed, 6 Mar 2024 13:42:57 +0100 Subject: [PATCH] cron: spread server load when upgrading hub and data files (#2873) --- config/crowdsec.cron.daily | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/crowdsec.cron.daily b/config/crowdsec.cron.daily index 1c110df38..9c488d298 100644 --- a/config/crowdsec.cron.daily +++ b/config/crowdsec.cron.daily @@ -2,12 +2,13 @@ test -x /usr/bin/cscli || exit 0 +# splay hub upgrade and crowdsec reload +sleep "$(seq 1 300 | shuf -n 1)" + /usr/bin/cscli --error hub update upgraded=$(/usr/bin/cscli --error hub upgrade) if [ -n "$upgraded" ]; then - # splay initial metrics push - sleep $(seq 1 90 | shuf -n 1) systemctl reload crowdsec fi