Skip to content

Commit

Permalink
fix: [DomClassifier] improve perf
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrtia committed Jan 9, 2024
1 parent 7263a97 commit 5094b2d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
20 changes: 11 additions & 9 deletions bin/modules/DomClassifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,17 @@ def compute(self, message, r_result=False):
for dns_record in self.c.vdomain:
self.add_message_to_queue(obj=None, message=dns_record)

localizeddomains = self.c.include(expression=self.cc_tld)
if localizeddomains:
print(localizeddomains)
self.redis_logger.warning(f"DomainC;{item_source};{item_date};{item_basename};Checked {localizeddomains} located in {self.cc_tld};{item.get_id()}")

localizeddomains = self.c.localizedomain(cc=self.cc)
if localizeddomains:
print(localizeddomains)
self.redis_logger.warning(f"DomainC;{item_source};{item_date};{item_basename};Checked {localizeddomains} located in {self.cc};{item.get_id()}")
if self.cc_tld:
localizeddomains = self.c.include(expression=self.cc_tld)
if localizeddomains:
print(localizeddomains)
self.redis_logger.warning(f"DomainC;{item_source};{item_date};{item_basename};Checked {localizeddomains} located in {self.cc_tld};{item.get_id()}")

if self.cc:
localizeddomains = self.c.localizedomain(cc=self.cc)
if localizeddomains:
print(localizeddomains)
self.redis_logger.warning(f"DomainC;{item_source};{item_date};{item_basename};Checked {localizeddomains} located in {self.cc};{item.get_id()}")

if r_result:
return self.c.vdomain
Expand Down
7 changes: 5 additions & 2 deletions configs/core.cfg.sample
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,13 @@ password = ail_trackers
cc_critical = DE

[DomClassifier]
cc = DE
cc_tld = r'\.de$'
#cc = DE
#cc_tld = r'\.de$'
cc =
cc_tld =
dns = 8.8.8.8


[Mail]
dns = 8.8.8.8

Expand Down

0 comments on commit 5094b2d

Please sign in to comment.