|
@@ -44,6 +44,8 @@ def webhook_get_promoter():
|
|
|
if media_id == '2' or media_id is None:
|
|
|
if r.zcard('kuaishou_shop_click_token') == 0:
|
|
|
cookie_update.get_click_coookie_to_redis()
|
|
|
+ r.close()
|
|
|
+
|
|
|
|
|
|
else:
|
|
|
random_member = r.zrange('kuaishou_shop_click_token', 0, -1, withscores=True)
|
|
@@ -56,7 +58,7 @@ def webhook_get_promoter():
|
|
|
if json.loads(roll)["result"] == 100110000:
|
|
|
r.zrem('kuaishou_shop_click_token', random_item[0])
|
|
|
SendFeiShuMsg.send_cookie_robot_msg(
|
|
|
- "cookie 永久失效 轻更新cookie 唯一电话为{phone_num}".format(phone_num=phone_num))
|
|
|
+ "cookie 永久失w效 轻更新cookie 唯一电话为{phone_num}".format(phone_num=phone_num))
|
|
|
retry_item = cookie_update.r.zrange('kuaishou_shop_click_token', 0, -1, withscores=True)
|
|
|
retry_cookie = retry_item[0].decode('utf-8')
|
|
|
cookie_update.update_cookie_handler(phone_num)
|
|
@@ -74,6 +76,7 @@ def webhook_get_promoter():
|
|
|
p3.start()
|
|
|
p4.start()
|
|
|
p5.start()
|
|
|
+ r.close()
|
|
|
return rollback
|
|
|
|
|
|
else:
|
|
@@ -112,6 +115,7 @@ def webhook_get_promoter():
|
|
|
p4.start()
|
|
|
p5.start()
|
|
|
r.zrem('kuaishou_shop_click_token', random_item[0])
|
|
|
+ r.close()
|
|
|
return roll
|
|
|
else:
|
|
|
rep = json.loads(request.data)
|
|
@@ -134,12 +138,14 @@ def webhook_update_promoter():
|
|
|
promoterId = rep["promoterId"]
|
|
|
if r.zcard('kuaishou_shop_click_token') == 0:
|
|
|
cookie_update.get_click_coookie_to_redis()
|
|
|
+ r.close()
|
|
|
|
|
|
else:
|
|
|
random_member = r.zrange('kuaishou_shop_click_token', 0, -1, withscores=True)
|
|
|
random_item = random.choice(random_member)
|
|
|
cookie = random_item[0].decode('utf-8')
|
|
|
ReturnPromoterInfoSpider().PromoterUpdate(promoterId, cookie)
|
|
|
+ r.close()
|
|
|
return '0'
|
|
|
|
|
|
|