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

Fix: split data and cache init #645

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<MasaFrameworkPackageVersion>1.2.0-preview.4</MasaFrameworkPackageVersion>
<MasaStackSdksPackageVersion>1.2.1-preview.8</MasaStackSdksPackageVersion>
<MasaFrameworkPackageVersion>1.2.0-preview.5</MasaFrameworkPackageVersion>
<MasaStackSdksPackageVersion>1.2.1-preview.10</MasaStackSdksPackageVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -526,13 +526,6 @@ public async Task InitConfigObjectAsync(
foreach (var configObject in configObjects)
{
var configObjectName = configObject.Key;
var key = $"{environmentName}-{clusterName}-{appId}-{configObjectName}".ToLower();
var redisData = await _memoryCacheClient.GetAsync<PublishReleaseModel?>(key);
if (redisData != null)
{
continue;
}

string content = configObject.Value;
if (isEncryption)
content = EncryptContent(content);
Expand Down Expand Up @@ -573,8 +566,18 @@ public async Task InitConfigObjectAsync(
}
}
}
await _configObjectRepository.AddAsync(newConfigObject);
await _unitOfWork.SaveChangesAsync();
if (await _configObjectRepository.FindAsync(x => x.Name == newConfigObject.Name && x.Type == newConfigObject.Type) == null)
{
await _configObjectRepository.AddAsync(newConfigObject);
await _unitOfWork.SaveChangesAsync();
}

var key = $"{environmentName}-{clusterName}-{appId}-{configObjectName}".ToLower();
var redisData = await _memoryCacheClient.GetAsync<PublishReleaseModel?>(key);
if (redisData != null)
{
continue;
}

var releaseModel = new AddConfigObjectReleaseDto
{
Expand Down
Loading