mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 12:25:53 +02:00
Download datafile (#895)
* add the ability to download datafile on cscli hub upgrade on files are missing * fix stuff + lint * fix error management Co-authored-by: sabban <15465465+sabban@users.noreply.github.com>
This commit is contained in:
parent
f64f20fd53
commit
4dbbd4b3c4
3 changed files with 52 additions and 8 deletions
|
@ -223,7 +223,11 @@ func UpgradeConfig(itemType string, name string, force bool) {
|
|||
found = true
|
||||
if v.UpToDate {
|
||||
log.Infof("%s : up-to-date", v.Name)
|
||||
|
||||
if !force {
|
||||
if err = cwhub.DownloadDataIfNeeded(csConfig.Hub, v, false); err != nil {
|
||||
log.Fatalf("%s : download failed : %v", v.Name, err)
|
||||
}
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue