| 
					
				 | 
			
			
				@@ -5,6 +5,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 # @Software: PyCharm 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import time 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import multiprocessing 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import os 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import gevent 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import datetime 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -209,7 +210,7 @@ def process_with_region(region, df_merged, app_type, data_key, rule_key, rule_pa 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 def process_with_app_type(app_type, params, region_code_list, feature_df, now_date, now_h): 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    log_.info(f"app_type = {app_type}") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    log_.info(f"app_type = {app_type} start...") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     data_params_item = params.get('data_params') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     rule_params_item = params.get('rule_params') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     for param in params.get('params_list'): 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -228,6 +229,7 @@ def process_with_app_type(app_type, params, region_code_list, feature_df, now_da 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             for region in region_code_list 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         ] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         gevent.joinall(task_list) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    log_.info(f"app_type = {app_type} end!") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 def rank_by_24h(project, table, now_date, now_h, rule_params, region_code_list): 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -241,6 +243,27 @@ def rank_by_24h(project, table, now_date, now_h, rule_params, region_code_list): 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     # ] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     # gevent.joinall(t) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    """ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ps = [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    for app_type, params in rule_params.items(): 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        p = multiprocessing.Process(target=process_with_app_type, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    args=(app_type, params, region_code_list, feature_df, now_date, now_h)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ps.append(p) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    for p in ps: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        p.daemon = True 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        p.start() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    for p in ps: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        p.join() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    """ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    pool = multiprocessing.Pool(processes=len(config_.APP_TYPE)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    for app_type, params in rule_params.items(): 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        pool.apply_async(func=process_with_app_type, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                         args=(app_type, params, region_code_list, feature_df, now_date, now_h)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    pool.close() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    pool.join() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    """ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     for app_type, params in rule_params.items(): 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         log_.info(f"app_type = {app_type} start...") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         data_params_item = params.get('data_params') 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -273,7 +296,7 @@ def rank_by_24h(project, table, now_date, now_h, rule_params, region_code_list): 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 t.join() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             log_.info(f"param = {param} end!") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         log_.info(f"app_type = {app_type} end!") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    """ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     # for app_type, params in rule_params.items(): 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     #     log_.info(f"app_type = {app_type}") 
			 |