Commit 0b931191 authored by 李小芳's avatar 李小芳

Merge branch 'change_time' into 'master'

add

See merge request !28
parents 3e368411 5d0b6d55
......@@ -54,8 +54,9 @@ def kafka_consum(topic_name=None):
# bol_consum = judge_data_have_in_redis(card_info)
bol_consum = True
if bol_consum:
logging.info("消费到新数据了[%s,%s,%s,%s],get card_info:%s" % (
str(msg.topic), str(msg.partition), str(msg.offset), str(msg.key), card_info))
logging.info("消费到新数据了[%s,%s,%s,%s],get card_id:%s,create_time:%s,current_push_time:%s" % (
str(msg.topic), str(msg.partition), str(msg.offset), str(msg.key),
card_info["card_id"], card_info['create_time'], card_info['current_push_time']))
# 如果没有代表是之前的老的数据
if 'card_status' not in card_info:
card_info['card_status'] = 'answer'
......@@ -99,7 +100,7 @@ def kafka_consum(topic_name=None):
card_info['have_comment_number'] < 20:
card_info["have_comment_number"] += 1
is_success = comment(card_info)
logging.info("comment [%s,%s,%s,%s],当前ID:%s,下发状状态:%s" % (
logging.info("comment [%s,%s,%s,%s],当前ID:%s,状态:%s" % (
str(msg.topic), str(msg.partition), str(msg.offset),
str(msg.key),
card_info["card_id"], is_success))
......@@ -113,7 +114,7 @@ def kafka_consum(topic_name=None):
if 'have_click_number' in card_info:
card_info["have_click_number"] += 1
is_success = click(card_info)
logging.info("click [%s,%s,%s,%s],当前ID:%s,下发状状态:%s" % (
logging.info("click [%s,%s,%s,%s],当前ID:%s,状态:%s" % (
str(msg.topic), str(msg.partition), str(msg.offset),
str(msg.key),
card_info["card_id"], is_success))
......@@ -126,7 +127,7 @@ def kafka_consum(topic_name=None):
if 'have_follow_number' in card_info:
card_info["have_follow_number"] += 1
is_success = follow(card_info)
logging.info("follow [%s,%s,%s,%s],当前ID:%s,下发状状态:%s" % (
logging.info("follow [%s,%s,%s,%s],当前ID:%s,状态:%s" % (
str(msg.topic), str(msg.partition), str(msg.offset),
str(msg.key),
card_info["card_id"], is_success))
......@@ -136,7 +137,7 @@ def kafka_consum(topic_name=None):
pass
else: # push_time时间未到 需要等待
logging.info("follow [%s,%s,%s,%s],push_time未到,需要等待" % (
logging.info("follow [%s,%s,%s,%s],等待" % (
str(msg.topic), str(msg.partition), str(msg.offset), str(msg.key)))
save_data_to_kafka(card_info)
else:
......
......@@ -27,8 +27,6 @@ def vest_irrigation(card_id=0, card_type=None, card_user_id=None, create_time=""
try:
producer = KafkaProducer(bootstrap_servers=settings.KAFKA_BROKER_LIST)
logging.info("新数据进来了:%s" % card_id)
topic = settings.KAFKA_TOPIC_NAME
tag_list = ["瘦脸针kyc", "双眼皮kyc", "水光针kyc", "玻尿酸kyc", "吸脂kyc", "祛痘kyc", "鼻综合kyc", "光子嫩肤kyc", "没有想法kyc",
"牙齿kyc", "抗衰紧致kyc", "胸部kyc", "果酸换肤kyc", "祛斑kyc", "美白针kyc", "瘦腿针kyc"]
......@@ -51,7 +49,6 @@ def vest_irrigation(card_id=0, card_type=None, card_user_id=None, create_time=""
'action_type': 'comment'
}
logging.info("get comment_msg_dict:%s" % comment_msg_dict)
producer.send(topic, json.dumps(comment_msg_dict).encode())
if card_type == 'answer':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment