Skip to content

Commit

Permalink
Fix: split data and cache init (#645)
Browse files Browse the repository at this point in the history
* fix: split data and cache init

* chore: upgrade sdk version
  • Loading branch information
Qinyouzeng authored Dec 10, 2024
1 parent c17cf92 commit 2dad71d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
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

0 comments on commit 2dad71d

Please sign in to comment.