File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -346,8 +346,8 @@ pub async fn login(
346346 } ;
347347
348348 let jitter = {
349- use rand:: Rng ;
350- rand :: thread_rng ( ) . gen_range ( 100 ..300 )
349+ let mut rng = rand:: rng ( ) ;
350+ rng . random_range ( 100 ..300 )
351351 } ;
352352 tokio:: time:: sleep ( Duration :: from_millis ( jitter) ) . await ;
353353
@@ -417,7 +417,12 @@ pub async fn login(
417417
418418 // Bug Fix 3: Probabilistic cleanup of expired tokens (1% chance)
419419 // This prevents the token_blacklist table from growing effectively unbounded.
420- if rand:: thread_rng ( ) . gen_bool ( 0.01 ) {
420+ let should_cleanup_blacklist = {
421+ let mut rng = rand:: rng ( ) ;
422+ rng. random_bool ( 0.01 )
423+ } ;
424+
425+ if should_cleanup_blacklist {
421426 let pool_clone = pool. clone ( ) ;
422427 tokio:: spawn ( async move {
423428 if let Err ( e) = repositories:: token_blacklist:: cleanup_expired ( & pool_clone) . await {
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ use tower_http::services::ServeDir;
2020/// - **Static Assets**: Serves the `uploads` directory safely via `tower-http`.
2121pub fn routes (
2222 upload_dir : String ,
23- admin_rate_limit_config : Arc < GovernorConfig < SmartIpKeyExtractor , NoOpMiddleware > > ,
23+ _admin_rate_limit_config : Arc < GovernorConfig < SmartIpKeyExtractor , NoOpMiddleware > > ,
2424 public_rate_limit_config : Arc < GovernorConfig < SmartIpKeyExtractor , NoOpMiddleware > > ,
2525) -> Router < DbPool > {
2626 Router :: new ( )
You can’t perform that action at this time.
0 commit comments