Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
token
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
wallet
token
Commits
dad76a08
Commit
dad76a08
authored
Oct 22, 2020
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
1990c78b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
IpExceptionController.php
console/controllers/IpExceptionController.php
+11
-8
No files found.
console/controllers/IpExceptionController.php
View file @
dad76a08
...
...
@@ -65,7 +65,7 @@ class IpExceptionController extends Controller
return
false
;
}
$redis_ticker
=
\Yii
::
$app
->
redis_es
;
//
$redis_ticker = \Yii::$app->redis_es;
$limit
=
\Yii
::
$app
->
params
[
'api_ip_limit'
][
'limit'
];
$white_list
=
\Yii
::
$app
->
params
[
'api_ip_limit'
][
'white_list'
];
$ips
=
''
;
...
...
@@ -73,14 +73,17 @@ class IpExceptionController extends Controller
if
(
in_array
(
$val
[
'key'
],
$white_list
))
continue
;
if
(
!
isset
(
$val
[
'request'
][
'buckets'
]))
continue
;
foreach
(
$val
[
'request'
][
'buckets'
]
as
$b
=>
$item
)
{
if
(
strpos
(
$item
[
'key'
],
'/interface/ticker/hot-ticker'
)
!==
false
)
{
if
(
$item
[
'doc_count'
]
>
$limit
)
{
foreach
(
$val
[
'request'
][
'buckets'
]
as
$bucket
)
{
$redis_ticker
->
hmset
(
$val
[
'key'
],
$bucket
[
'key'
],
$bucket
[
'doc_count'
]);
}
$ips
.=
$val
[
'key'
]
.
','
;
}
if
(
$item
[
'doc_count'
]
>
$limit
)
{
$ips
.=
$val
[
'key'
]
.
','
;
}
// if (strpos($item['key'],'/interface/ticker/hot-ticker') !== false) {
// if ($item['doc_count'] > $limit) {
// foreach ($val['request']['buckets'] as $bucket) {
// $redis_ticker->hmset($val['key'], $bucket['key'], $bucket['doc_count']);
// }
// $ips .= $val['key'] . ',';
// }
// }
}
}
...
...
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