Document dependency from account deactivator to autoUpdateAccountActiveStatus

There was a non-obvious dependency from the AccountDeactivator task to
the auth.autoUpdateAccountActiveStatus. A properly configured account
deactivator task wouldn't be scheduled if the
autoUpdateAccountActiveStatus was set to false and the reason wasn't
obvious to a Gerrit admin.

Also log a warning if the account deactivation task is configured but
will not be scheduled.

Change-Id: Icf13c1b306c52c815438c01d23aa38df0ba30793
This commit is contained in:
Saša Živkov
2020-03-17 12:20:31 +01:00
parent 3a85a1a803
commit f0966117b0
2 changed files with 11 additions and 3 deletions

View File

@@ -5059,6 +5059,10 @@ account deactivations.
The link:#schedule-configuration-interval[interval] for running
account deactivations.
Note that the task will only be scheduled if the
link:#autoUpdateAccountActiveStatus[auth.autoUpdateAccountActiveStatus]
is set to true.
link:#schedule-configuration-examples[Schedule examples] can be found
in the link:#schedule-configuration[Schedule Configuration] section.

View File

@@ -57,10 +57,14 @@ public class AccountDeactivator implements Runnable {
@Override
public void start() {
if (!supportAutomaticAccountActivityUpdate) {
return;
if (schedule.isPresent()) {
if (supportAutomaticAccountActivityUpdate) {
queue.scheduleAtFixedRate(deactivator, schedule.get());
} else {
logger.atWarning().log(
"Not scheduling AccountDeactivator because auth.autoUpdateAccountActiveStatus is false");
}
}
schedule.ifPresent(s -> queue.scheduleAtFixedRate(deactivator, s));
}
@Override