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
1ff9c9e3
Commit
1ff9c9e3
authored
Oct 13, 2021
by
朱允伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
<fix> 网关限流添加打印日志
parent
23a76368
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
api-service-gateway/src/main/java/com/zorkdata/apiservice/gateway/filter/GatewayFilter.java
...com/zorkdata/apiservice/gateway/filter/GatewayFilter.java
+0
-2
api-service-gateway/src/main/java/com/zorkdata/apiservice/gateway/schedule/RefreshApiLimitSchedule.java
.../apiservice/gateway/schedule/RefreshApiLimitSchedule.java
+2
-1
No files found.
api-service-gateway/src/main/java/com/zorkdata/apiservice/gateway/filter/GatewayFilter.java
View file @
1ff9c9e3
...
...
@@ -11,8 +11,6 @@ import org.springframework.stereotype.Component;
import
org.springframework.web.server.ServerWebExchange
;
import
reactor.core.publisher.Mono
;
import
java.util.logging.Logger
;
/**
* @author zyw
* @create 2021-10-08-18:37
...
...
api-service-gateway/src/main/java/com/zorkdata/apiservice/gateway/schedule/RefreshApiLimitSchedule.java
View file @
1ff9c9e3
...
...
@@ -46,11 +46,12 @@ public class RefreshApiLimitSchedule {
try
{
JSONObject
jo
=
new
JSONObject
(
queryResult
);
JSONArray
data
=
jo
.
getJSONArray
(
"data"
);
ApiLimitCache
.
BUCKET_CACHE
.
clear
();
for
(
int
i
=
0
;
i
<
data
.
length
();
i
++)
{
JSONObject
o
=
(
JSONObject
)
data
.
get
(
i
);
String
name
=
o
.
get
(
"name"
).
toString
();
Integer
singleLimit
=
Integer
.
parseInt
(
o
.
get
(
"single_limit"
).
toString
());
log
.
info
(
"接口{}限流次数{}"
,
name
,
singleLimit
);
//桶的最大容量,即能装载 Token 的最大数量
int
capacity
=
singleLimit
;
//每次 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