Check if the result limit has been hit
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
@@ -15,6 +15,7 @@ type LeakResult struct {
|
||||
Duration time.Duration
|
||||
Rows []map[string]string
|
||||
Error string
|
||||
LimitHit bool // Whether the search hit the limit
|
||||
}
|
||||
|
||||
func Search(s *server.Server, queryText, column string, exactMatch bool) LeakResult {
|
||||
@@ -76,6 +77,10 @@ func Search(s *server.Server, queryText, column string, exactMatch bool) LeakRes
|
||||
return result
|
||||
}
|
||||
|
||||
if len(result.Rows) >= s.Settings.Limit {
|
||||
result.LimitHit = true
|
||||
}
|
||||
|
||||
result.Rows = removeDuplicateMaps(result.Rows)
|
||||
|
||||
result.Duration = time.Since(now)
|
||||
|
||||
Reference in New Issue
Block a user