Commit 384d27ea authored by 宋柯's avatar 宋柯

降配

parent dc8cd111
......@@ -54,7 +54,7 @@ class Parse_data:
rate = len_data_diff / per_sec
self.offset_dict[key_name] = len_data
if len_data_diff > 0:
use_time = round(len_data / rate / (60 / per_sec) / 60, 1)
use_time = round(len_data / rate / 3600, 1)
return "{} 目前{}队列中有{}条数据,预计{}小时后处理完成".format(time_ts, key_name, str(len_data), str(use_time))
else:
if abs(rate) > 0:
......@@ -87,10 +87,12 @@ if __name__ == "__main__":
"mentha-tapir-answer": redis_new_mimas,
"mentha-tapir-tractate": redis_new_mimas,
}
per_sec = 60 * 10
per_sec = 60 * 5
last_time = time.time()
while True:
now = datetime.datetime.now()
if now.second % per_sec == 0:
now = time.time()
if now - last_time >= per_sec:
for redis_clint_key in redis_clicnt_dct:
len_list_and_send_msg(redis_clicnt_dct[redis_clint_key], redis_clint_key, rules, per_sec)
last_time = now
time.sleep(1)
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