From 31fb3f1a58d127c4386227ae337579ce3161423f Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Mon, 2 Jan 2023 16:34:22 -0800 Subject: [PATCH] use a const --- web3_proxy/src/user_queries.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web3_proxy/src/user_queries.rs b/web3_proxy/src/user_queries.rs index fdf87249..6d2f5a94 100644 --- a/web3_proxy/src/user_queries.rs +++ b/web3_proxy/src/user_queries.rs @@ -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)