cron: spread server load when upgrading hub and data files (#2873)
This commit is contained in:
parent
d8877a71fc
commit
5356ccc6cd
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue