Commit f29106b3 authored by cuiweifeng's avatar cuiweifeng

update : add apcu send mail 60s

parent 87e7fb9c
......@@ -2,10 +2,12 @@
namespace Api\PhpUtils\Log;
use Api\PhpUtils\Cache\ApcuUtil;
use Api\PhpUtils\Message\Email;
class FileLog
{
const PREFIX_FILELOG_ERROR = 'flerr:';
/**
* 用于记录info级别的错误
* 会记录请求上下文,不会发生报警邮件
......@@ -135,10 +137,11 @@ class FileLog
private static function shouldSendEmail($key)
{
$result = true;
// $cache = new CommonCacheUtil(RedisUtil::CODIS_CLUSTER_ACTION);
// if ($cache->add($key, true, 60, CacheUtil::PREFIX_SEND_MAIL) === false) {
// $result = false;
// }
// 每分钟发一条
if (! ApcuUtil::apcu_add_one(self::PREFIX_FILELOG_ERROR, $key, 1, 60)) {
$result = false;
}
return $result;
}
}
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