Skip to content

Commit 80457f7

Browse files
authored
chore: update tower_governor crate to 0.4.0 (#434)
1 parent 8fe31fe commit 80457f7

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

Cargo.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ axum-extra = { version = "0.9.3", features = [
3232
"typed-header",
3333
], default-features = false }
3434
autometrics = { version = "1.0.1", features = ["prometheus-exporter"] }
35-
tower_governor = "0.3.2"
35+
tower_governor = "0.4.0"
3636
tower-http = { version = "0.5.2", features = [
3737
"cors",
3838
"normalize-path",

common/src/indexer_service/http/indexer_service.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,13 +344,13 @@ impl IndexerService {
344344
// time between consecutive requests after that, effectively rate
345345
// limiting to 10 req/s.
346346
let misc_rate_limiter = GovernorLayer {
347-
config: Box::leak(Box::new(
347+
config: Arc::new(
348348
GovernorConfigBuilder::default()
349349
.per_millisecond(100)
350350
.burst_size(10)
351351
.finish()
352352
.expect("Failed to set up rate limiting"),
353-
)),
353+
),
354354
};
355355

356356
let operator_address = Json(
@@ -367,13 +367,13 @@ impl IndexerService {
367367
// time between consecutive requests after that, effectively rate
368368
// limiting to 50 req/s.
369369
let static_subgraph_rate_limiter = GovernorLayer {
370-
config: Box::leak(Box::new(
370+
config: Arc::new(
371371
GovernorConfigBuilder::default()
372372
.per_millisecond(20)
373373
.burst_size(50)
374374
.finish()
375375
.expect("Failed to set up rate limiting"),
376-
)),
376+
),
377377
};
378378

379379
if options.config.service.serve_network_subgraph {

0 commit comments

Comments
 (0)