Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear the tenant cache when creating/update/deleting. #18412

Merged
merged 5 commits into from Dec 30, 2023
Merged

Conversation

maliming
Copy link
Member

@maliming maliming commented Dec 8, 2023

Resolve #18393

We'll use IDistributedCache<TenantConfigurationCacheItem> in MvcRemoteTenantStore and TenantStore.

MvcRemoteTenantStore:

var cacheKey = TenantConfigurationCacheItem.CalculateCacheKey(id);

var tenantConfiguration = await Cache.GetAsync(cacheKey);
if (tenantConfiguration == null)
{
    // FindTenantByIdAsync will write tenant cache.
    await TenantAppService.FindTenantByIdAsync(id);

    // Get cache again.
    tenantConfiguration = await Cache.GetAsync(cacheKey);
}

return tenantConfiguration?.Value;

@maliming maliming added this to the 8.1-preview milestone Dec 8, 2023
@maliming maliming marked this pull request as ready for review December 8, 2023 08:04
Copy link

codecov bot commented Dec 8, 2023

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (006b26e) 51.72% compared to head (58f31c8) 51.58%.
Report is 10 commits behind head on dev.

❗ Current head 58f31c8 differs from pull request most recent head dfac82c. Consider uploading reports for the commit dfac82c to get more accurate results

Files Patch % Lines
...o/Abp/MultiTenancy/TenantConfigurationCacheItem.cs 72.72% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #18412      +/-   ##
==========================================
- Coverage   51.72%   51.58%   -0.14%     
==========================================
  Files        3075     3073       -2     
  Lines       96949    96847     -102     
  Branches     7719     7707      -12     
==========================================
- Hits        50146    49962     -184     
- Misses      45268    45358      +90     
+ Partials     1535     1527       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hikalkan hikalkan merged commit 3221e89 into dev Dec 30, 2023
2 of 3 checks passed
@hikalkan hikalkan deleted the Clear-Tenant-Cache branch December 30, 2023 15:31
@hikalkan
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Find a way to clear the AbpAspNetCoreMvcClient's cache.
2 participants