Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
api-service-gateway
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
朱允伟
api-service-gateway
Commits
e26be66a
Commit
e26be66a
authored
Oct 13, 2021
by
朱允伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
<fix> 网关限流添加打印日志
parent
735b5728
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
api-service-gateway/src/main/java/com/zorkdata/apiservice/gateway/schedule/RefreshApiLimitSchedule.java
.../apiservice/gateway/schedule/RefreshApiLimitSchedule.java
+1
-2
No files found.
api-service-gateway/src/main/java/com/zorkdata/apiservice/gateway/schedule/RefreshApiLimitSchedule.java
View file @
e26be66a
...
@@ -46,12 +46,11 @@ public class RefreshApiLimitSchedule {
...
@@ -46,12 +46,11 @@ public class RefreshApiLimitSchedule {
try
{
try
{
JSONObject
jo
=
new
JSONObject
(
queryResult
);
JSONObject
jo
=
new
JSONObject
(
queryResult
);
JSONArray
data
=
jo
.
getJSONArray
(
"data"
);
JSONArray
data
=
jo
.
getJSONArray
(
"data"
);
ApiLimitCache
.
BUCKET_CACHE
.
clear
();
for
(
int
i
=
0
;
i
<
data
.
length
();
i
++)
{
for
(
int
i
=
0
;
i
<
data
.
length
();
i
++)
{
JSONObject
o
=
(
JSONObject
)
data
.
get
(
i
);
JSONObject
o
=
(
JSONObject
)
data
.
get
(
i
);
String
name
=
o
.
get
(
"name"
).
toString
();
String
name
=
o
.
get
(
"name"
).
toString
();
Integer
singleLimit
=
Integer
.
parseInt
(
o
.
get
(
"single_limit"
).
toString
());
Integer
singleLimit
=
Integer
.
parseInt
(
o
.
get
(
"single_limit"
).
toString
());
log
.
info
(
"接口{}限流次数{}"
,
name
,
singleLimit
);
//
log.info("接口{}限流次数{}",name, singleLimit);
//桶的最大容量,即能装载 Token 的最大数量
//桶的最大容量,即能装载 Token 的最大数量
int
capacity
=
singleLimit
;
int
capacity
=
singleLimit
;
//每次 Token 补充量
//每次 Token 补充量
...
...
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