Misc code householding
- Checkstyle config: allow todo comments with issue number
- Create consistency tests across all classes, ensuring: unique class names, users of expiring collectors implement HasCleanup, non-private fields are only constants
- Fix tag replacement in PlayerListener for {DISPLAYNAME}
This commit is contained in:
@@ -2,6 +2,7 @@ package fr.xephi.authme.service;
|
||||
|
||||
import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.initialization.HasCleanup;
|
||||
import fr.xephi.authme.initialization.Reloadable;
|
||||
import fr.xephi.authme.mail.EmailService;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
@@ -25,7 +26,7 @@ import static fr.xephi.authme.settings.properties.EmailSettings.RECOVERY_PASSWOR
|
||||
/**
|
||||
* Manager for password recovery.
|
||||
*/
|
||||
public class PasswordRecoveryService implements Reloadable {
|
||||
public class PasswordRecoveryService implements Reloadable, HasCleanup {
|
||||
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
@@ -163,4 +164,10 @@ public class PasswordRecoveryService implements Reloadable {
|
||||
successfulRecovers.setExpiration(
|
||||
commonService.getProperty(SecuritySettings.PASSWORD_CHANGE_TIMEOUT), TimeUnit.MINUTES);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void performCleanup() {
|
||||
emailCooldown.removeExpiredEntries();
|
||||
successfulRecovers.removeExpiredEntries();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user