mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 12:25:53 +02:00
Minor changes to specific logs (#900)
- Minor changes to specific logs - Fix LAPI to not push signals to CAPI when disabled #907
This commit is contained in:
parent
488f28e3a3
commit
448a227079
12 changed files with 29 additions and 23 deletions
|
@ -166,12 +166,16 @@ func (c *Controller) CreateAlert(gctx *gin.Context) {
|
|||
for _, alert := range input {
|
||||
alert.MachineID = machineID
|
||||
}
|
||||
select {
|
||||
case c.CAPIChan <- input:
|
||||
log.Debugf("alert sent to CAPI channel")
|
||||
default:
|
||||
log.Warningf("Cannot send alert to Central API channel")
|
||||
|
||||
if c.CAPIChan != nil {
|
||||
select {
|
||||
case c.CAPIChan <- input:
|
||||
log.Debug("alert sent to CAPI channel")
|
||||
default:
|
||||
log.Warning("Cannot send alert to Central API channel")
|
||||
}
|
||||
}
|
||||
|
||||
gctx.JSON(http.StatusCreated, alerts)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue