Commit 6a3afab3 authored by lixiaofang's avatar lixiaofang

修改bug

parent e956c403
...@@ -151,14 +151,13 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type ...@@ -151,14 +151,13 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type
card_info['have_comment_number'] = 0 card_info['have_comment_number'] = 0
now = datetime.datetime.now() now = datetime.datetime.now()
createt = datetime.datetime.strptime(create_time, '%Y-%m-%d %H:%M:%S') createt = datetime.datetime.strptime(create_time, '%Y-%m-%d %H:%M:%S')
# nowt = now.strftime('%Y-%m-%d %H:%M:%S')
##获取创建时间和当前时间的相差秒数
# num = (now - createt).total_seconds()
num_days = (now - createt).days num_days = (now - createt).days
content_day_need_add_one_day = False content_day_need_add_one_day = False
if after_day == True and card_info is not None: if after_day == True and card_info is not None:
num_days += repeat_time num_days += repeat_time
content_day_need_add_one_day = True content_day_need_add_one_day = True
logging.info("get-----------------num_days:%s" % num_days)
# 创建时间切换成分钟数便于比较 # 创建时间切换成分钟数便于比较
# mins = divmod(num, min)[0] # mins = divmod(num, min)[0]
##根据转换后的分钟数进行比较 ##根据转换后的分钟数进行比较
...@@ -169,6 +168,8 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type ...@@ -169,6 +168,8 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type
return get_time, time_region return get_time, time_region
elif num_days >= 1 and num_days <= 6: elif num_days >= 1 and num_days <= 6:
logging.info("get-----------------num_days:%s" % num_days)
get_time = get_one_six_days_random_time(content_level=content_level, num_days=num_days, get_time = get_one_six_days_random_time(content_level=content_level, num_days=num_days,
action_type=action_type, action_type=action_type,
content_day_need_add_one_day=content_day_need_add_one_day) content_day_need_add_one_day=content_day_need_add_one_day)
...@@ -176,6 +177,8 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type ...@@ -176,6 +177,8 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type
return get_time, time_region return get_time, time_region
elif num_days > 6 and num_days <= 365: elif num_days > 6 and num_days <= 365:
logging.info("get-----------------num_days:%s" % num_days)
get_time = get_ten_last_days_random_time(num_days=num_days, content_level=content_level, 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, content_day_need_add_one_day=content_day_need_add_one_day,
action_type=action_type) action_type=action_type)
...@@ -185,6 +188,7 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type ...@@ -185,6 +188,7 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type
else: else:
##需要删掉kafka的数据不再进行下发 ##需要删掉kafka的数据不再进行下发
return [], 3 return [], 3
logging.info("get-----------------get_time:%s" % get_time)
except: except:
logger.error("catch exception,err_log:%s" % traceback.format_exc()) logger.error("catch exception,err_log:%s" % traceback.format_exc())
......
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