feat(router): add route to invalidate cache entry (#1100)

Co-authored-by: jeeva <jeeva.ramu@codurance.com>
Co-authored-by: Sanchith Hegde <22217505+SanchithHegde@users.noreply.github.com>
This commit is contained in:
Jeeva
2023-06-21 08:40:03 +01:00
committed by GitHub
parent 2b71d4d8c4
commit 21f2ccd47c
14 changed files with 271 additions and 43 deletions

View File

@ -96,11 +96,14 @@ pub async fn make_stream_available(
stream_name_flag: &str,
redis: &redis::RedisConnectionPool,
) -> errors::DrainerResult<()> {
redis
.delete_key(stream_name_flag)
.await
.map_err(DrainerError::from)
.into_report()
match redis.delete_key(stream_name_flag).await {
Ok(redis::DelReply::KeyDeleted) => Ok(()),
Ok(redis::DelReply::KeyNotDeleted) => {
logger::error!("Tried to unlock a stream which is already unlocked");
Ok(())
}
Err(error) => Err(DrainerError::from(error).into()),
}
}
pub fn parse_stream_entries<'a>(