2 Commits 4a6053f3ee ... 33c35aaa10

Author SHA1 Message Date
  chenzhiyuan 33c35aaa10 Merge branch 'master' of http://101.200.220.49:8001/houxiaohua/shop_live_scraper 3 years ago
  chenzhiyuan 2064f684ea 减少线程数量 3 years ago
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
 
56
 
57
     rds = RdsUserInfoList()
57
     rds = RdsUserInfoList()
58
     print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + ' ' + ' 开始执行,待更新直播队列长度:' + str(rds.get_len()))
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
         task = threading.Thread(target=scrape, name=i)
60
         task = threading.Thread(target=scrape, name=i)
61
         task.start()  # 准备就绪,等待cpu执行
61
         task.start()  # 准备就绪,等待cpu执行

+ 1 - 1
rds_model/rds_user_info_list.py

18
     # 新增待更新用户
18
     # 新增待更新用户
19
     def put_wait_update_user(self, sec_uid):
19
     def put_wait_update_user(self, sec_uid):
20
         key = 'BrandLiveData.DyWaitingUpdateUserInfoList'
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
     def put_user_info(self, data):
24
     def put_user_info(self, data):