fix: improve accuracy of rate limit error message in cache API testing and simplify function by removing unused config parameter
parent
2d0cbeaf18
commit
d3179944c0
|
@ -55,7 +55,6 @@ pub async fn test_cache_content_api(
|
|||
client: Client,
|
||||
api_endpoint: impl IntoUrl,
|
||||
validated_key: ValidatedKey,
|
||||
config: KeyCheckerConfig,
|
||||
) -> ValidatedKey {
|
||||
let api_endpoint = api_endpoint.into_url().unwrap();
|
||||
|
||||
|
@ -64,7 +63,7 @@ pub async fn test_cache_content_api(
|
|||
&api_endpoint,
|
||||
validated_key.key.clone(),
|
||||
&*CACHE_CONTENT_TEST_BODY,
|
||||
config.max_retries,
|
||||
1,
|
||||
)
|
||||
.await
|
||||
{
|
||||
|
@ -78,7 +77,7 @@ pub async fn test_cache_content_api(
|
|||
Err(e) => match &e {
|
||||
ValidatorError::HttpTooManyRequests { .. } => {
|
||||
debug!(
|
||||
"FREE KEY DETECTED - {}... - Cache API not accessible",
|
||||
"FREE KEY DETECTED - {}... - Rate limit exceeded for cache API",
|
||||
&validated_key.key.as_ref()[..10]
|
||||
);
|
||||
validated_key
|
||||
|
|
|
@ -61,12 +61,7 @@ impl ValidationService {
|
|||
.buffer_unordered(self.config.concurrency)
|
||||
.filter_map(|result| async { result.ok() })
|
||||
.map(|validated_key| {
|
||||
test_cache_content_api(
|
||||
self.client.clone(),
|
||||
cache_api_url.clone(),
|
||||
validated_key,
|
||||
self.config.clone(),
|
||||
)
|
||||
test_cache_content_api(self.client.clone(), cache_api_url.clone(), validated_key)
|
||||
})
|
||||
.buffer_unordered(self.config.concurrency);
|
||||
pin_mut!(valid_keys_stream);
|
||||
|
|
Loading…
Reference in New Issue