mirror of
https://github.com/pesde-pkg/pesde.git
synced 2024-12-12 11:00:36 +00:00
feat: remove ratelimits on info queries
This commit is contained in:
parent
f2deb64f1c
commit
b1a0cf6637
1 changed files with 3 additions and 19 deletions
|
@ -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",
|
||||||
|
|
Loading…
Reference in a new issue