Procházet zdrojové kódy

Use a better OlderThan for DeleteInactiveUsers (#19693)

* Use a better OlderThan for DeleteInactiveUsers

- Currently the OlderThan is zero, for instances that enable or run this
task this could actually delete just new users that still need to
confirm their email. This patch fixes that by setting the default to the
`ActiveCodeLives` setting, which corresponds to the amount of time that
a user can active their account, thus avoiding the issue of deleting
unactivated email users.

* Use correct duration
tags/v1.18.0-dev
Gusted před 2 roky
rodič
revize
61f939359d
Žádný účet není propojen s e-mailovou adresou tvůrce revize
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1
    1
      services/cron/tasks_extended.go

+ 1
- 1
services/cron/tasks_extended.go Zobrazit soubor

@@ -26,7 +26,7 @@ func registerDeleteInactiveUsers() {
RunAtStart: false,
Schedule: "@annually",
},
OlderThan: 0 * time.Second,
OlderThan: time.Minute * time.Duration(setting.Service.ActiveCodeLives),
}, func(ctx context.Context, _ *user_model.User, config Config) error {
olderThanConfig := config.(*OlderThanConfig)
return user_service.DeleteInactiveUsers(ctx, olderThanConfig.OlderThan)

Načítá se…
Zrušit
Uložit