cron: spread server load when upgrading hub and data files (#2873)

This commit is contained in:
mmetc 2024-03-06 13:42:57 +01:00 committed by GitHub
parent d8877a71fc
commit 5356ccc6cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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