Skip to content

Commit

Permalink
Merge pull request #187 from harris2012/patch-1
Browse files Browse the repository at this point in the history
仅主库的agc_app表有数据,删除逻辑,移动到循环删除子环境数据之前
  • Loading branch information
kklldog authored Sep 7, 2024
2 parents 5f789d3 + a87177d commit 3416e6f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/AgileConfig.Server.Service/AppService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public async Task<bool> DeleteAsync(App app)
app = await _appRepository.GetAsync(app.Id);
if (app != null)
{
await _appRepository.DeleteAsync(app);

var envs = await _settingService.GetEnvironmentList();
var updatedConfigIds = new List<string>();
var updatedConfigPublishedIds = new List<string>();
Expand All @@ -67,9 +69,9 @@ public async Task<bool> DeleteAsync(App app)
{
using var configRepository = _configRepositoryAccessor(env);
using var configPublishedRepository = _configPublishedRepositoryAccessor(env);
await _appRepository.DeleteAsync(app);

//怕有的同学误删app导致要恢复,所以保留配置项吧。
var configs = await configRepository.QueryAsync(x => x.AppId == app.Id);
var configs = await configRepository.QueryAsync(x => x.AppId == app.Id && x.Status == ConfigStatus.Enabled);
var waitDeleteConfigs = new List<Config>();
foreach (var item in configs)
{
Expand Down

0 comments on commit 3416e6f

Please sign in to comment.