Skip to content

Commit

Permalink
Merge branch 'feature/filters-list-per-client'
Browse files Browse the repository at this point in the history
  • Loading branch information
hoang-rio committed Jul 9, 2024
2 parents 864e7e4 + 8e17c76 commit 71b8a19
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/filtering/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@ func (d *DNSFilter) LoadClientFilters(array []ClientFilterYAML) {
func (d *DNSFilter) InitForClient(clientName string, whiteListFilters, filters []FilterYAML, userRules []string) {
d.clientEngineLock.Lock()
defer d.clientEngineLock.Unlock()
_, ok := d.ClientsFilteringEngine[clientName]
if ok {
log.Info("filtering: client filtering of client: %s already initiated", clientName)
return
}
log.Info("filtering: start init client filtering for client: %s", clientName)
d.LoadFilters(whiteListFilters)
d.LoadFilters(filters)
Expand Down Expand Up @@ -350,7 +355,7 @@ func (d *DNSFilter) InitForClient(clientName string, whiteListFilters, filters [
// Make sure that the OS reclaims memory as soon as possible.
debug.FreeOSMemory()

log.Info("Finish init client filtering for client: %s", clientName)
log.Info("filtering: finish init client filtering for client: %s", clientName)
}

func deduplicateFilters(filters []FilterYAML) (deduplicated []FilterYAML) {
Expand Down

0 comments on commit 71b8a19

Please sign in to comment.