|
@@ -139,12 +139,12 @@ class PushObject:
|
|
|
except Exception as e:
|
|
|
LOGGER.info('IOS推送异常: {}, 证书路径: {}'.format(repr(e), pem_path))
|
|
|
|
|
|
- # 限制每小时发送一次
|
|
|
+ # 限制每种app包每天发送一次
|
|
|
redis_obj = RedisObject()
|
|
|
key = 'ios_push_error_mail_{}'.format(app_bundle_id)
|
|
|
- time_limit = redis_obj.get_data(key)
|
|
|
- if not time_limit:
|
|
|
- redis_obj.set_data(key, 1, 60 * 60)
|
|
|
+ is_lock = redis_obj.CONN.setnx(key, 1)
|
|
|
+ redis_obj.CONN.expire(key, 60*60*24)
|
|
|
+ if not is_lock:
|
|
|
email_content = '{}服IOS推送异常: {}, 证书路径: {}'.format(CONFIG_INFO, repr(e), pem_path)
|
|
|
S3Email().send_email(email_content, 'servers@ansjer.com')
|
|
|
|