Skip to content

Commit

Permalink
Add temp cache for entity handler
Browse files Browse the repository at this point in the history
  • Loading branch information
sunny-k123 committed Dec 10, 2024
1 parent c09ce1c commit 27d1c30
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/CAServer.Application/EntityHandler/TempCacheProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public TempCacheProvider(

public async Task<Dictionary<string, string>> GetCacheByModuleAsync(string module)
{
_logger.LogDebug("TempCacheProvider GetCacheByModuleAsync module = {0} ", module);
Dictionary<string, string> convertedDictionary = new Dictionary<string, string>();

try
Expand Down Expand Up @@ -65,6 +66,7 @@ public async Task<Dictionary<string, string>> GetCacheByModuleAsync(string modul

public async Task<bool> SetCacheAsync(string module, string key, string value)
{
_logger.LogDebug("TempCacheProvider SetCacheAsync module = {0} key = {1} value = {2} has error", module, key, value);
try
{
string fullKey = GetCacheKey(module, key);
Expand All @@ -82,6 +84,7 @@ public async Task<bool> SetCacheAsync(string module, string key, string value)

public async Task<bool> RemoveCacheAsync(string module, string key, string value)
{
_logger.LogDebug("TempCacheProvider RemoveCacheAsync module = {0} key = {1} value = {2}", module, key, value);
try
{
string fullKey = GetCacheKey(module, key);
Expand All @@ -97,6 +100,7 @@ public async Task<bool> RemoveCacheAsync(string module, string key, string value

public async Task<bool> RemoveCacheByFullKeyAsync(string module, string fullKey, string value)
{
_logger.LogDebug("TempCacheProvider RemoveCacheByFullKeyAsync module = {0} key = {1} value = {2}", module, fullKey, value);
try
{
await _cacheProvider.SetRemoveAsync(GetCacheKey(module), new List<string> { fullKey });
Expand Down

0 comments on commit 27d1c30

Please sign in to comment.