Browse Source

always show banned host in ui

When an host is banned but the updated_time field is in the past the ui
didn't show the record.

Fixes #758

Signed-off-by: lucatiozzo91 <luca.tiozzo91@gmail.com>
lucatiozzo91 3 years ago
parent
commit
7b86e2ac59
1 changed files with 1 additions and 1 deletions
  1. 1 1
      dataprovider/sqlqueries.go

+ 1 - 1
dataprovider/sqlqueries.go

@@ -47,7 +47,7 @@ func getAddDefenderEventQuery() string {
 }
 
 func getDefenderHostsQuery() string {
-	return fmt.Sprintf(`SELECT id,ip,ban_time FROM %v WHERE updated_at >= %v ORDER BY updated_at DESC LIMIT %v`,
+	return fmt.Sprintf(`SELECT id,ip,ban_time FROM %v WHERE updated_at >= %v OR ban_time > 0 ORDER BY updated_at DESC LIMIT %v`,
 		sqlTableDefenderHosts, sqlPlaceholders[0], sqlPlaceholders[1])
 }