fix(bot): allow deleting all cleanup rules

This commit is contained in:
ShukeBta
2026-06-07 15:26:09 +08:00
parent 33698daa3f
commit afd42a5985
2 changed files with 29 additions and 1 deletions
+1 -1
View File
@@ -141,7 +141,7 @@ func loadBotConfig(ctx context.Context, repo *repository.Container) botConfig {
cfg.AccountCleanupRequiredCount = parseIntSettingDefault(get(SettingAccountCleanupRequiredCount), cfg.AccountCleanupRequiredCount)
if raw := strings.TrimSpace(get(SettingAccountCleanupRules)); raw != "" {
var rules []accountCleanupRule
if err := json.Unmarshal([]byte(raw), &rules); err == nil && len(rules) > 0 {
if err := json.Unmarshal([]byte(raw), &rules); err == nil {
cfg.AccountCleanupRules = normalizeCleanupRules(rules)
}
}