mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-02 03:29:07 +02:00
[management] move rate limiter to shared package (#7727)
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
"github.com/google/uuid"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/netbirdio/netbird/management/server/http/middleware"
|
||||
"github.com/netbirdio/netbird/shared/ratelimit"
|
||||
"github.com/netbirdio/netbird/upload-server/types"
|
||||
)
|
||||
|
||||
@@ -21,7 +21,7 @@ const (
|
||||
|
||||
type Server struct {
|
||||
srv *http.Server
|
||||
limiter *middleware.APIRateLimiter
|
||||
limiter *ratelimit.APIRateLimiter
|
||||
}
|
||||
|
||||
func NewServer() *Server {
|
||||
@@ -63,7 +63,7 @@ func (s *Server) Stop() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func configureMux(mux *http.ServeMux) (*middleware.APIRateLimiter, error) {
|
||||
func configureMux(mux *http.ServeMux) (*ratelimit.APIRateLimiter, error) {
|
||||
limiter := newRateLimiter()
|
||||
|
||||
_, ok := os.LookupEnv(bucketVar)
|
||||
|
||||
Reference in New Issue
Block a user