Browse Source

减少线程数量

chenzhiyuan 3 years ago
parent
commit
2064f684ea
2 changed files with 2 additions and 2 deletions
  1. 1 1
      dy_userinfo_update.py
  2. 1 1
      rds_model/rds_user_info_list.py

+ 1 - 1
dy_userinfo_update.py

@@ -56,6 +56,6 @@ if __name__ == "__main__":
56 56
 
57 57
     rds = RdsUserInfoList()
58 58
     print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + ' ' + ' 开始执行,待更新直播队列长度:' + str(rds.get_len()))
59
-    for i in range(1, 50):
59
+    for i in range(1, 30):
60 60
         task = threading.Thread(target=scrape, name=i)
61 61
         task.start()  # 准备就绪,等待cpu执行

+ 1 - 1
rds_model/rds_user_info_list.py

@@ -18,7 +18,7 @@ class RdsUserInfoList:
18 18
     # 新增待更新用户
19 19
     def put_wait_update_user(self, sec_uid):
20 20
         key = 'BrandLiveData.DyWaitingUpdateUserInfoList'
21
-        return self.redis.lpush(key, sec_uid)
21
+        return self.redis.rpush(key, sec_uid)
22 22
 
23 23
     # 已获取好的用户信息加入到列队
24 24
     def put_user_info(self, data):