feat: add a service for periodic cleanup of error accounts based on configuration.

This commit is contained in:
2026-02-01 06:02:39 +08:00
parent e867bc5cbd
commit 14a07e741e
5 changed files with 85 additions and 10 deletions

View File

@@ -89,13 +89,10 @@ func checkAndCleanErrors() {
}
if len(errorAccounts) == 0 {
logger.Info("没有错误账号需要清理", "", "cleaner")
lastCleanTime = time.Now()
return
}
logger.Info(fmt.Sprintf("找到 %d 个错误账号,开始删除...", len(errorAccounts)), "", "cleaner")
success := 0
failed := 0
@@ -106,7 +103,6 @@ func checkAndCleanErrors() {
logger.Warning(fmt.Sprintf("删除账号失败: ID=%d, Email=%s, Error=%v", account.ID, account.Email, err), account.Email, "cleaner")
} else {
success++
logger.Success(fmt.Sprintf("删除账号成功: ID=%d, Email=%s", account.ID, account.Email), account.Email, "cleaner")
}
}