fix:[RegexTracker] fix search regex helper

pull/519/head
Terrtia 2020-06-29 11:01:30 +02:00
parent 9ce2eb1e79
commit f20df89446
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
1 changed files with 2 additions and 1 deletions

View File

@ -76,7 +76,8 @@ def regex_findall(module_name, redis_key, regex, item_id, item_content, max_time
def _regex_search(redis_key, regex, item_content): def _regex_search(redis_key, regex, item_content):
first_occ = regex.search(item_content) first_occ = regex.search(item_content)
r_serv_cache.set(redis_key, first_occ) if first_occ:
r_serv_cache.set(redis_key, first_occ)
def regex_search(module_name, redis_key, regex, item_id, item_content, max_time=30): def regex_search(module_name, redis_key, regex, item_id, item_content, max_time=30):
proc = Proc(target=_regex_search, args=(redis_key, regex, item_content, )) proc = Proc(target=_regex_search, args=(redis_key, regex, item_content, ))