diff options
Diffstat (limited to 'src/main/java/com/juick/EmailManager.java')
-rw-r--r-- | src/main/java/com/juick/EmailManager.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/com/juick/EmailManager.java b/src/main/java/com/juick/EmailManager.java index 62584273..6180668e 100644 --- a/src/main/java/com/juick/EmailManager.java +++ b/src/main/java/com/juick/EmailManager.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2020, Juick + * Copyright (C) 2008-2023, Juick * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -45,6 +45,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.event.EventListener; import org.springframework.scheduling.annotation.Async; +import org.springframework.scheduling.annotation.Scheduled; import javax.annotation.Nonnull; import javax.inject.Inject; @@ -196,4 +197,9 @@ public class EmailManager implements NotificationListener { return false; } } + @Scheduled(fixedRate = 3600000) + public void cleanupAuth() { + var rowsDeleted = emailService.cleanupAuthCodes(); + logger.debug("{} auth codes deleted", rowsDeleted); + } } |