liqian 2 years ago
parent
commit
608ced98f1
1 changed files with 3 additions and 2 deletions
  1. 3 2
      user_group_update.py

+ 3 - 2
user_group_update.py

@@ -99,11 +99,12 @@ async def get_mid_group_mapping(feature_df, group_list):
         # pool.close()
         # pool.join()
 
-        step = len(mid_list) // (100 - 1)
+        # step = len(mid_list) // (100 - 1)
+        step = 100
         loop = asyncio.get_running_loop()
         executor = ThreadPoolExecutor(max_workers=20)
         tasks = []
-        for i in range(100 + 1):
+        for i in range(len(mid_list)//step + 1):
             log_.info(f"i = {i}")
             process_mid_list = mid_list[i * step:(i + 1) * step]
             tasks.append(loop.run_in_executor(executor, mapping_process, group, process_mid_list))