Skip to content

Commit d836123

Browse files
committed
feat: add rate limiting to subgraph health endpoint
1 parent bd5cf36 commit d836123

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

common/src/indexer_service/http/indexer_service.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ impl IndexerService {
386386
.route("/", get("Service is up and running"))
387387
.route("/version", get(Json(options.release)))
388388
.route("/info", get(operator_address))
389-
.layer(misc_rate_limiter);
389+
.layer(misc_rate_limiter.clone());
390390

391391
// Rate limits by allowing bursts of 50 requests and requiring 20ms of
392392
// time between consecutive requests after that, effectively rate
@@ -404,7 +404,8 @@ impl IndexerService {
404404
// Check subgraph Health
405405
misc_routes = misc_routes
406406
.route("/subgraph/health/:deployment_id", get(health))
407-
.route_layer(Extension(options.config.graph_node.clone()));
407+
.route_layer(Extension(options.config.graph_node.clone()))
408+
.layer(misc_rate_limiter);
408409

409410
if options.config.service.serve_network_subgraph {
410411
info!("Serving network subgraph at /network");

0 commit comments

Comments
 (0)