mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
fix: throw bad request while pushing duplicate data to redis (#3016)
This commit is contained in:
@ -3,7 +3,7 @@ use data_models::errors::StorageError;
|
||||
use diesel::PgConnection;
|
||||
use error_stack::{IntoReport, ResultExt};
|
||||
|
||||
use crate::{metrics, DatabaseStore};
|
||||
use crate::{errors::RedisErrorExt, metrics, DatabaseStore};
|
||||
|
||||
pub async fn pg_connection_read<T: DatabaseStore>(
|
||||
store: &T,
|
||||
@ -64,7 +64,8 @@ where
|
||||
metrics::KV_MISS.add(&metrics::CONTEXT, 1, &[]);
|
||||
database_call_closure().await
|
||||
}
|
||||
_ => Err(redis_error.change_context(StorageError::KVError)),
|
||||
// Keeping the key empty here since the error would never go here.
|
||||
_ => Err(redis_error.to_redis_failed_response("")),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user