Commit a6d98355 authored by 张彦钊's avatar 张彦钊

for debug supervisor,change get_active_users,con_sql

parent cc482f19
......@@ -12,7 +12,7 @@ def get_active_users():
sql = "select device_id from user_active_time " \
"where active_time <= '{}' and active_time >= '{}'".format(now_end,now_start)
device_id_df = con_sql(sql)
if device_id_df.empty:
if device_id_df == "0":
print("当下这一分钟没有活跃用户,不需要预测")
# 为了debug supervisor,修改了下面的return参数
return 1,[1,2]
......
......@@ -16,7 +16,11 @@ def con_sql(sql):
result = cursor.fetchall()
df = pd.DataFrame(list(result)).dropna()
db.close()
return df
# 为了debug supervisor,加了下面的代码
if df.empty:
return "0"
else:
return df
# 把数据写到redis里
# TODO 生产环境的redis地址没有提供,下面的地址是测试环境的,需要改成生产环境地址
......
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