refactor(redis): spawn one subscriber thread for handling all the published messages to different channel (#5064)

This commit is contained in:
Chethan Rao
2024-06-21 17:01:52 +05:30
committed by GitHub
parent 2005d3df9f
commit 6a07e10af3
5 changed files with 159 additions and 125 deletions

View File

@ -72,7 +72,7 @@ impl ConfigInterface for Store {
self.get_redis_conn()
.map_err(Into::<errors::StorageError>::into)?
.publish(
cache::PUB_SUB_CHANNEL,
cache::IMC_INVALIDATION_CHANNEL,
CacheKind::Config((&inserted.key).into()),
)
.await
@ -179,7 +179,10 @@ impl ConfigInterface for Store {
self.get_redis_conn()
.map_err(Into::<errors::StorageError>::into)?
.publish(cache::PUB_SUB_CHANNEL, CacheKind::Config(key.into()))
.publish(
cache::IMC_INVALIDATION_CHANNEL,
CacheKind::Config(key.into()),
)
.await
.map_err(Into::<errors::StorageError>::into)?;

View File

@ -74,7 +74,7 @@ pub async fn get_store(
tenant,
master_enc_key,
cache_store,
storage_impl::redis::cache::PUB_SUB_CHANNEL,
storage_impl::redis::cache::IMC_INVALIDATION_CHANNEL,
)
.await?
};