feat: remove ratelimits on info queries

This commit is contained in:
daimond113 2024-08-27 21:10:24 +02:00
parent f2deb64f1c
commit b1a0cf6637
No known key found for this signature in database
GPG key ID: 3A8ECE51328B513C

View file

@ -118,13 +118,6 @@ async fn run(with_sentry: bool) -> std::io::Result<()> {
search_writer: Mutex::new(search_writer), search_writer: Mutex::new(search_writer),
}); });
let generic_governor_config = GovernorConfigBuilder::default()
.burst_size(500)
.per_millisecond(500)
.use_headers()
.finish()
.unwrap();
let publish_governor_config = GovernorConfigBuilder::default() let publish_governor_config = GovernorConfigBuilder::default()
.key_extractor(UserIdExtractor) .key_extractor(UserIdExtractor)
.burst_size(12) .burst_size(12)
@ -151,23 +144,14 @@ async fn run(with_sentry: bool) -> std::io::Result<()> {
) )
.service( .service(
web::scope("/v0") web::scope("/v0")
.route( .route("/search", web::get().to(endpoints::search::search_packages))
"/search",
web::get()
.to(endpoints::search::search_packages)
.wrap(Governor::new(&generic_governor_config)),
)
.route( .route(
"/packages/{name}", "/packages/{name}",
web::get() web::get().to(endpoints::package_versions::get_package_versions),
.to(endpoints::package_versions::get_package_versions)
.wrap(Governor::new(&generic_governor_config)),
) )
.route( .route(
"/packages/{name}/{version}/{target}", "/packages/{name}/{version}/{target}",
web::get() web::get().to(endpoints::package_version::get_package_version),
.to(endpoints::package_version::get_package_version)
.wrap(Governor::new(&generic_governor_config)),
) )
.route( .route(
"/packages", "/packages",