Skip to content

Commit

Permalink
use async sleep in pepper (aptos-labs#12344)
Browse files Browse the repository at this point in the history
* use async sleep in pepper

* lint
  • Loading branch information
zjma authored Mar 2, 2024
1 parent 2508826 commit f0ba79d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions keyless/pepper/service/src/jwk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use jsonwebtoken::{
};
use log::{info, warn};
use once_cell::sync::Lazy;
use std::{sync::Arc, thread::sleep, time::Duration};
use std::{sync::Arc, time::Duration};

/// The JWK in-mem cache.
pub static DECODING_KEY_CACHE: Lazy<DashMap<Issuer, DashMap<KeyID, Arc<DecodingKey>>>> =
Expand Down Expand Up @@ -63,7 +63,7 @@ pub fn start_jwk_refresh_loop(issuer: &str, jwk_url: &str, refresh_interval: Dur
warn!("{}", msg);
},
}
sleep(refresh_interval);
tokio::time::sleep(refresh_interval).await;
}
});
}
Expand Down

0 comments on commit f0ba79d

Please sign in to comment.