Commit a68453a0 authored by 李小芳's avatar 李小芳

修改某些队列的报警时间

parent 6fc739b7
......@@ -39,7 +39,7 @@ token_dict = {
# send_msg_to_dingtalk("123",secret=secret,access_token=access_token)
#
redis_old_gaia = redis.StrictRedis.from_url("redis://:ReDis!GmTx*0aN11@172.16.40.166:6379/9", decode_responses=True)
redis_old_mimas = redis.StrictRedis.from_url("redis://:ReDis!GmTx*0aN3@172.16.40.145:6379/5", decode_responses=True)
redis_new_gaia = redis.StrictRedis.from_url("redis://:ReDis!GmTx*0aN19@172.16.50.166:6379", decode_responses=True)
......@@ -108,19 +108,22 @@ if __name__ == "__main__":
"graces-es6-tapir-lbs": redis_new_gaia,
"graces-es6-tapir-merchant": redis_new_gaia,
}
per_sec = 60 * 5
thirty_per_sec = 60 * 30
per_sec = 5
thirty_per_sec = 30
last_time = time.time()
num = 0
while True:
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
num += 1
if now - last_time >= thirty_per_sec:
if num == 6:
for redis_clint_key in thirty_redis_clicnt_dct:
len_list_and_send_msg(thirty_redis_clicnt_dct[redis_clint_key], redis_clint_key, rules, thirty_per_sec)
last_time = now
num =0
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