Skip to content

Commit

Permalink
fix: change >= to > to not set expiry as 0
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisIsMani committed Nov 28, 2024
1 parent 4526a43 commit 9fd6e01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/router/src/services/authorization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ where
i64::try_from(token.exp).change_context(ApiErrorResponse::InternalServerError)?;
let cache_ttl = token_expiry - common_utils::date_time::now_unix_timestamp();

if cache_ttl >= 0 {
if cache_ttl > 0 {
set_role_info_in_cache(state, &token.role_id, &role_info, cache_ttl)
.await
.map_err(|e| logger::error!("Failed to set role info in cache {e:?}"))
Expand Down

0 comments on commit 9fd6e01

Please sign in to comment.