use a const

This commit is contained in:
Bryan Stitt 2023-01-02 16:34:22 -08:00
parent eaea79c055
commit 31fb3f1a58

@ -90,10 +90,10 @@ pub async fn get_user_id_from_params(
if save_to_redis {
// TODO: how long? we store in database for 4 weeks
let one_day = 60 * 60 * 24;
const ONE_DAY: usize = 60 * 60 * 24;
if let Err(err) = redis_conn
.set_ex::<_, _, ()>(user_redis_key, user_id, one_day)
.set_ex::<_, _, ()>(user_redis_key, user_id, ONE_DAY)
.await
{
warn!("Unable to save user bearer token to redis: {}", err)