Skip to content

Commit cd39e10

Browse files
AlteredCoderAlteredCoder
authored andcommitted
improve debug
1 parent 380763d commit cd39e10

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

custom.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ func (c *customBouncer) Delete(decision *models.Decision) error {
5454
if err != nil {
5555
log.Warningf("serialize: %s", err)
5656
}
57+
log.Printf("custom [%s] : del ban on %s for %s sec (%s)", c.path, *decision.Value, strconv.Itoa(int(banDuration.Seconds())), *decision.Scenario)
5758
cmd := exec.Command(c.path, "del", *decision.Value, strconv.Itoa(int(banDuration.Seconds())), *decision.Scenario, str)
5859
if out, err := cmd.CombinedOutput(); err != nil {
5960
log.Infof("Error in 'del' command (%s): %v --> %s", cmd.String(), err, string(out))

main.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"fmt"
66
"os"
77
"os/signal"
8-
"strings"
98
"syscall"
109

1110
"github.com/coreos/go-systemd/daemon"
@@ -107,9 +106,7 @@ func main() {
107106
log.Infof("deleting '%d' decisions", len(decisions.Deleted))
108107
for _, decision := range decisions.Deleted {
109108
if err := custom.Delete(decision); err != nil {
110-
if !strings.Contains(err.Error(), "netlink receive: no such file or directory") {
111-
log.Errorf("unable to delete decision for '%s': %s", *decision.Value, err)
112-
}
109+
log.Errorf("unable to delete decision for '%s': %s", *decision.Value, err)
113110
} else {
114111
log.Debugf("deleted '%s'", *decision.Value)
115112
}

0 commit comments

Comments
 (0)