Commit 0eea5e38 authored by lixiaofang's avatar lixiaofang

修日志

parent 31770047
......@@ -83,7 +83,6 @@ def auto_click_user(card_info, after_day=False):
else: # 代表还有push好的时间没有下发完成 需要继续使用这些
logging.info("get--------click--------------card_info:%s" % card_info)
current_user_id = card_info["current_user_id"]
card_info["all_follow_id"].remove(current_user_id)
current_push_time = card_info['current_push_time']
......
......@@ -95,10 +95,8 @@ def auto_comment_user(card_info, after_day=False):
break
repeat_time += 1
logging.info("get have_get_after__time:%s" % card_info)
logging.info("get comment_have_get_after__time:%s" % card_info)
else: # 代表还有push好的时间没有下发完成 需要继续使用这些
logging.info("get-------comment---------------card_info:%s" % card_info)
current_user_id = card_info["current_user_id"]
card_info["all_follow_id"].remove(current_user_id)
current_push_time = card_info['current_push_time']
......
......@@ -101,8 +101,6 @@ def auto_follow_user(card_info, after_day=False):
save_data_to_kafka(card_info) # 存储数据
logging.info("get-----follow----card_info:%s" % card_info)
except:
logging_exception()
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
......@@ -41,7 +41,6 @@ def kafka_consum(topic_name=None):
nowtime = datetime.datetime.now()
push_time_date = datetime.datetime.strptime(current_push_time, '%Y-%m-%d %H:%M:%S')
if push_time_date <= nowtime: # push_time已经到时间了 需要去下发
logging.info("get push_time_date:%s" % push_time_date)
# 判断如果当前的push_time 和当前的创建时间一样 需要给push_time下发真的push时间
if current_push_time == create_time:
if card_info['action_type'] == "comment":
......
......@@ -18,7 +18,7 @@ def vest_irrigation(card_id=0, card_type=None, card_user_id=None, create_time=""
producer = KafkaProducer(bootstrap_servers=[settings.KAFKA_BROKER_LIST])
logging.info("------------------------")
logging.info("-----------------------------------------------")
topic = settings.KAFKA_TOPIC_NAME
tag_list = ["瘦脸针kyc", "双眼皮kyc", "水光针kyc", "玻尿酸kyc", "吸脂kyc", "祛痘kyc", "鼻综合kyc", "光子嫩肤kyc", "没有想法kyc",
......@@ -73,7 +73,6 @@ def vest_irrigation(card_id=0, card_type=None, card_user_id=None, create_time=""
producer.send(topic, json.dumps(click_msg_dict).encode())
producer.close()
logging.info("------------------------")
except:
logging_exception()
......
......@@ -162,13 +162,11 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type
##根据转换后的分钟数进行比较
##转化成分数后进行一层一层的比较
if num_days == 0:
logging.info("-------------当天----------------------------")
get_time = randomDate(create_time=createt, action_type=action_type)
time_region = 0
return get_time, time_region
elif num_days >= 1 and num_days <= 6:
logging.info("-------------1-6天的----------------------------")
get_time = get_one_six_days_random_time(content_level=content_level, num_days=num_days,
action_type=action_type,
......@@ -177,8 +175,6 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type
return get_time, time_region
elif num_days > 6 and num_days <= 365:
logging.info("-------------6天后的---------------------------")
get_time = get_ten_last_days_random_time(num_days=num_days, content_level=content_level,
content_day_need_add_one_day=content_day_need_add_one_day)
time_region = 2
......@@ -186,7 +182,6 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type
else:
##需要删掉kafka的数据不再进行下发
logging.info("-------------所有下发结束---------------------------")
return [], 3
except:
......@@ -217,8 +212,6 @@ def get_click_follow_time_by_create_time(create_time="", content_level=0, action
if num_days == 0:
logging.info("-------------当天----------------------------")
get_time = randomDate(create_time=createt, action_type=action_type)
logging.info("拿到当天的时间 get get_time:%s" % get_time)
return get_time, 0
elif num_days == 1:
......@@ -226,14 +219,12 @@ def get_click_follow_time_by_create_time(create_time="", content_level=0, action
content_level=content_level,
content_day_need_add_one_day=content_day_need_add_one_day)
logging.info("1天的 get get_time:%s" % get_time)
return get_time, 1
elif num_days > 1 and num_days <= 15:
get_time = get_one_six_days_random_time(num_days=num_days, action_type=action_type,
content_level=content_level,
content_day_need_add_one_day=content_day_need_add_one_day)
logging.info("2-15天后的的时间 get get_time:%s" % get_time)
return get_time, 2
......@@ -242,12 +233,9 @@ def get_click_follow_time_by_create_time(create_time="", content_level=0, action
get_time = get_ten_last_days_random_time(num_days=num_days, action_type=action_type,
content_level=content_level,
content_day_need_add_one_day=content_day_need_add_one_day)
logging.info("拿到15天后的时间 get get_time:%s" % get_time)
return get_time, 4
else:
logging.info("-------------所有下发结束---------------------------")
return [], 3
except:
......
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