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

仅主库的agc_app表有数据,删除逻辑,移动到循环删除子环境数据之前 #187

Merged
merged 2 commits into from
Sep 7, 2024
Merged
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
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
Loading