Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
25ff9ebb
authored
Apr 26, 2023
by
JustSong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: remove rate limit for relay api
parent
9c529f96
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
common/constants.go
+1
-1
router/relay-router.go
+2
-2
No files found.
common/constants.go
View file @
25ff9ebb
...
...
@@ -65,7 +65,7 @@ var (
// All duration's unit is seconds
// Shouldn't larger then RateLimitKeyExpirationDuration
var
(
GlobalApiRateLimitNum
=
60000
// TODO: temporary set to 6000
0
GlobalApiRateLimitNum
=
18
0
GlobalApiRateLimitDuration
int64
=
3
*
60
GlobalWebRateLimitNum
=
60
...
...
router/relay-router.go
View file @
25ff9ebb
...
...
@@ -8,12 +8,12 @@ import (
func
SetRelayRouter
(
router
*
gin
.
Engine
)
{
relayV1Router
:=
router
.
Group
(
"/v1"
)
relayV1Router
.
Use
(
middleware
.
GlobalAPIRateLimit
(),
middleware
.
TokenAuth
(),
middleware
.
Distribute
())
relayV1Router
.
Use
(
middleware
.
TokenAuth
(),
middleware
.
Distribute
())
{
relayV1Router
.
Any
(
"/*path"
,
controller
.
Relay
)
}
relayDashboardRouter
:=
router
.
Group
(
"/dashboard"
)
relayDashboardRouter
.
Use
(
middleware
.
GlobalAPIRateLimit
(),
middleware
.
TokenAuth
(),
middleware
.
Distribute
())
relayDashboardRouter
.
Use
(
middleware
.
TokenAuth
(),
middleware
.
Distribute
())
{
relayDashboardRouter
.
Any
(
"/*path"
,
controller
.
Relay
)
}
...
...
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