|
@@ -14,9 +14,9 @@ from utils.deepseek_utils import get_keyword_summary, update_keyword_summary_pro
|
|
|
|
|
|
|
|
|
|
|
|
|
class KeywordSummaryTask:
|
|
class KeywordSummaryTask:
|
|
|
|
|
+ lock_dict = {} # 静态变量,不会随着每次实例化而重置
|
|
|
def __init__(self):
|
|
def __init__(self):
|
|
|
self.executor = ThreadPoolExecutor(max_workers=20, thread_name_prefix='KeywordSummaryTask')
|
|
self.executor = ThreadPoolExecutor(max_workers=20, thread_name_prefix='KeywordSummaryTask')
|
|
|
- self.lock_dict = {}
|
|
|
|
|
|
|
|
|
|
def get_lock_for_keyword(self, keyword_id):
|
|
def get_lock_for_keyword(self, keyword_id):
|
|
|
if keyword_id not in self.lock_dict:
|
|
if keyword_id not in self.lock_dict:
|