Support broadcast deletion

This commit is contained in:
2024-09-19 22:23:32 +08:00
parent ee16094855
commit 184fc3ecba
6 changed files with 37 additions and 4 deletions

View File

@ -13,7 +13,7 @@ func DoAutoDatabaseCleanup() {
// Deal soft-deletion
var count int64
for _, model := range database.DatabaseAutoActionRange {
for _, model := range database.AutoMaintainRange {
tx := database.C.Unscoped().Delete(model, "deleted_at >= ?", deadline)
if tx.Error != nil {
log.Error().Err(tx.Error).Msg("An error occurred when running database cleanup...")