Skip to content

Commit

Permalink
enhancement: force hub index file update if hub data upgrade is forced
Browse files Browse the repository at this point in the history
  • Loading branch information
nox-x committed Jul 11, 2024
1 parent 1b01041 commit 89142ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docker/docker_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ cscli() {

run_hub_update() {
index_modification_time=$(stat -c %Y /etc/crowdsec/hub/.index.json 2>/dev/null)
# Run cscli hub update if no date or if the index file is older than 24h
if [ -z "$index_modification_time" ] || [ $(( $(date +%s) - index_modification_time )) -gt 86400 ]; then
# Run cscli hub update if forced to upgrade hub data, if no date or if the index file is older than 24h
if istrue "$DO_HUB_UPGRADE" || [ -z "$index_modification_time" ] || [ $(( $(date +%s) - index_modification_time )) -gt 86400 ]; then
cscli hub update
else
echo "Skipping hub update, index file is recent"
Expand Down

0 comments on commit 89142ac

Please sign in to comment.