Skip to content

Commit fe4cdc3

Browse files
sypharJoshua Nelson
authored and
Joshua Nelson
committed
add/fix logging statements
1 parent 37ca7cd commit fe4cdc3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/web/releases.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ impl Default for Search {
500500
fn redirect_to_random_crate(req: &Request, conn: &mut PoolClient) -> IronResult<Response> {
501501
// since there is a chance of this query returning an empty result,
502502
// we retry a certain amount of times, and log a warning.
503-
for _ in 0..20 {
503+
for i in 0..20 {
504504
let rows = ctry!(
505505
req,
506506
conn.query(
@@ -550,12 +550,13 @@ fn redirect_to_random_crate(req: &Request, conn: &mut PoolClient) -> IronResult<
550550
let mut resp = Response::with((status::Found, Redirect(url)));
551551
resp.headers.set(Expires(HttpDate(time::now())));
552552

553+
log::debug!("finished random crate search on iteration {}", i);
553554
return Ok(resp);
554555
} else {
555-
::log::warn!("retrying random crate search");
556+
log::warn!("retrying random crate search");
556557
}
557558
}
558-
::log::error!("found no result in random crate search");
559+
log::error!("found no result in random crate search");
559560

560561
Err(Nope::NoResults.into())
561562
}

0 commit comments

Comments
 (0)