Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
php_utils
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
php_utils
Commits
f29106b3
Commit
f29106b3
authored
Aug 01, 2021
by
cuiweifeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update : add apcu send mail 60s
parent
87e7fb9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
FileLog.php
src/Log/FileLog.php
+7
-4
No files found.
src/Log/FileLog.php
View file @
f29106b3
...
...
@@ -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
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment