3397a570 by 冯轩

Merge branch 'feature/CHINARPA-5155' into feature/uat-tmp

2 parents 6b8916c6 ff65d75c
...@@ -8,4 +8,6 @@ broker = conf.CELERY_BROKER_URL ...@@ -8,4 +8,6 @@ broker = conf.CELERY_BROKER_URL
8 8
9 app = Celery('celery_compare', broker=broker, include=['celery_compare.tasks']) 9 app = Celery('celery_compare', broker=broker, include=['celery_compare.tasks'])
10 10
11 app.conf.update(worker_max_tasks_per_child=5, timezone='Asia/Shanghai') 11 # worker_max_tasks_per_child ,worker执行了几次任务就会死
12 #app.conf.update(worker_max_tasks_per_child=10, timezone='Asia/Shanghai')
13 app.conf.update(timezone='Asia/Shanghai')
......
...@@ -55,7 +55,7 @@ import threading ...@@ -55,7 +55,7 @@ import threading
55 import concurrent.futures 55 import concurrent.futures
56 from concurrent.futures import ThreadPoolExecutor 56 from concurrent.futures import ThreadPoolExecutor
57 57
58 pool = ThreadPoolExecutor(max_workers=20, thread_name_prefix="my_thread_") 58 pool = ThreadPoolExecutor(max_workers=50, thread_name_prefix="compare_thread_")
59 59
60 compare_log = logging.getLogger('compare') 60 compare_log = logging.getLogger('compare')
61 log_base = '[Compare]' 61 log_base = '[Compare]'
...@@ -3732,7 +3732,9 @@ def fsm_compare(application_id, application_entity, uniq_seq, ocr_res_id, is_ca= ...@@ -3732,7 +3732,9 @@ def fsm_compare(application_id, application_entity, uniq_seq, ocr_res_id, is_ca=
3732 # results = list(executor.map(fsm_compare_thread, application_id, application_entity, uniq_seq, ocr_res_id, is_ca, is_cms)) 3732 # results = list(executor.map(fsm_compare_thread, application_id, application_entity, uniq_seq, ocr_res_id, is_ca, is_cms))
3733 3733
3734 compare_log.info('[fsm thread]') 3734 compare_log.info('[fsm thread]')
3735 #pool = ThreadPoolExecutor(max_workers=6, thread_name_prefix="fsm_thread_")
3735 pool.submit(fsm_compare_thread, application_id, application_entity, uniq_seq, ocr_res_id, is_ca, is_cms) 3736 pool.submit(fsm_compare_thread, application_id, application_entity, uniq_seq, ocr_res_id, is_ca, is_cms)
3737 #pool.shutdown(wait=True)
3736 3738
3737 3739
3738 def fsm_compare_thread(application_id, application_entity, uniq_seq, ocr_res_id, is_ca=True, is_cms=False): 3740 def fsm_compare_thread(application_id, application_entity, uniq_seq, ocr_res_id, is_ca=True, is_cms=False):
...@@ -3808,7 +3810,9 @@ def compare(application_id, application_entity, uniq_seq, ocr_res_id, is_ca=True ...@@ -3808,7 +3810,9 @@ def compare(application_id, application_entity, uniq_seq, ocr_res_id, is_ca=True
3808 # results = list(executor.map(compare_thread, application_id, application_entity, uniq_seq, ocr_res_id, is_ca, is_cms)) 3810 # results = list(executor.map(compare_thread, application_id, application_entity, uniq_seq, ocr_res_id, is_ca, is_cms))
3809 3811
3810 compare_log.info('[non fsm thread]') 3812 compare_log.info('[non fsm thread]')
3813 #pool = ThreadPoolExecutor(max_workers=6, thread_name_prefix="non_fsm_thread_")
3811 pool.submit(compare_thread, application_id, application_entity, uniq_seq, ocr_res_id, is_ca, is_cms) 3814 pool.submit(compare_thread, application_id, application_entity, uniq_seq, ocr_res_id, is_ca, is_cms)
3815 #pool.shutdown(wait=True)
3812 3816
3813 def compare_thread(application_id, application_entity, uniq_seq, ocr_res_id, is_ca=True, is_cms=False): 3817 def compare_thread(application_id, application_entity, uniq_seq, ocr_res_id, is_ca=True, is_cms=False):
3814 # POS: application_id, application_entity, uniq_seq, None 3818 # POS: application_id, application_entity, uniq_seq, None
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!