|
@@ -323,9 +323,8 @@ class SerialNumberView(View):
|
|
redis_obj.rpush(USED_SERIAL_REDIS_LIST, serial)
|
|
redis_obj.rpush(USED_SERIAL_REDIS_LIST, serial)
|
|
|
|
|
|
redis_obj = RedisObject()
|
|
redis_obj = RedisObject()
|
|
- time_limit_out = redis_obj.CONN.setnx('uid_count_warning', 1)
|
|
|
|
- redis_obj.CONN.expire('uid_count_warning', 60*60*24) # 限制一天提醒一次
|
|
|
|
- if time_limit_out:
|
|
|
|
|
|
+ time_limit = redis_obj.get_data('uid_count_warning_time_limit')
|
|
|
|
+ if not time_limit:
|
|
vpg_id = 1
|
|
vpg_id = 1
|
|
if CONFIG_INFO == CONFIG_US:
|
|
if CONFIG_INFO == CONFIG_US:
|
|
vpg_id = 3
|
|
vpg_id = 3
|
|
@@ -339,6 +338,8 @@ class SerialNumberView(View):
|
|
LOGGER.info('uid剩余数量:{}'.format(unused_uid_count))
|
|
LOGGER.info('uid剩余数量:{}'.format(unused_uid_count))
|
|
warning_count = 2000
|
|
warning_count = 2000
|
|
if unused_uid_count < warning_count:
|
|
if unused_uid_count < warning_count:
|
|
|
|
+ # 限制一天提醒一次
|
|
|
|
+ redis_obj.set_data('uid_count_warning_time_limit', 1, 60*60*24)
|
|
platform = '尚云' if p2p_type == 1 else 'tutk'
|
|
platform = '尚云' if p2p_type == 1 else 'tutk'
|
|
email_content = '{}服{}的uid数量少于{}个,请及时处理'.format(CONFIG_INFO, platform, warning_count)
|
|
email_content = '{}服{}的uid数量少于{}个,请及时处理'.format(CONFIG_INFO, platform, warning_count)
|
|
S3Email().faEmail(email_content, 'servers@ansjer.com')
|
|
S3Email().faEmail(email_content, 'servers@ansjer.com')
|