fix(thumbnails): Implement ratelimit for the grpc service
This moves the ratelimit ('THUMBNAILS_MAX_CONCURRENT_REQUESTS') from the
HTTP endpoint to the GRPC endpoint. The HTTP endpoint is just used for
downloading already created thumbnails. But the resource consuming part of
thumbnail generation happens in the GRPC service.
This commit is contained in:
committed by
Ralf Haferkamp
parent
9e978e290a
commit
e2d7251893
@@ -59,6 +59,7 @@ func Server(cfg *config.Config) *cli.Command {
|
||||
grpc.Address(cfg.GRPC.Addr),
|
||||
grpc.Metrics(m),
|
||||
grpc.TraceProvider(traceProvider),
|
||||
grpc.MaxConcurrentRequests(cfg.GRPC.MaxConcurrentRequests),
|
||||
)
|
||||
|
||||
gr.Add(service.Run, func(_ error) {
|
||||
@@ -91,7 +92,6 @@ func Server(cfg *config.Config) *cli.Command {
|
||||
http.Metrics(m),
|
||||
http.Namespace(cfg.HTTP.Namespace),
|
||||
http.TraceProvider(traceProvider),
|
||||
http.MaxConcurrentRequests(cfg.HTTP.MaxConcurrentRequests),
|
||||
)
|
||||
if err != nil {
|
||||
logger.Info().
|
||||
|
||||
Reference in New Issue
Block a user