mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-30 09:47:17 +00:00
fix: [Credential] add regex timeout
This commit is contained in:
parent
52b7f13a6f
commit
c3d37f2bbf
1 changed files with 13 additions and 1 deletions
|
@ -148,8 +148,20 @@ if __name__ == "__main__":
|
||||||
p.populate_set_out(msg, 'Tags')
|
p.populate_set_out(msg, 'Tags')
|
||||||
|
|
||||||
#Put in form, count occurences, then send to moduleStats
|
#Put in form, count occurences, then send to moduleStats
|
||||||
creds_sites = {}
|
signal.alarm(max_execution_time)
|
||||||
|
try:
|
||||||
site_occurence = re.findall(regex_site_for_stats, content)
|
site_occurence = re.findall(regex_site_for_stats, content)
|
||||||
|
except TimeoutException:
|
||||||
|
p.incr_module_timeout_statistic()
|
||||||
|
err_mess = "Credential: site occurence, processing timeout: {}".format(item_id)
|
||||||
|
print(err_mess)
|
||||||
|
publisher.info(err_mess)
|
||||||
|
site_occurence = []
|
||||||
|
else:
|
||||||
|
signal.alarm(0)
|
||||||
|
|
||||||
|
creds_sites = {}
|
||||||
|
|
||||||
for site in site_occurence:
|
for site in site_occurence:
|
||||||
site_domain = site[1:-1]
|
site_domain = site[1:-1]
|
||||||
if site_domain in creds_sites.keys():
|
if site_domain in creds_sites.keys():
|
||||||
|
|
Loading…
Reference in a new issue