diff options
author | Vitaly Takmazov | 2023-01-16 09:21:49 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-16 09:27:20 +0300 |
commit | b836c344d49a8d3ad8f7d164bf0425b59df51384 (patch) | |
tree | aa262c5f85cc4edb1c95295e14e1c40d201d9ff1 /src/main/java/com/juick/EmailManager.java | |
parent | 0c30281a5a0745927b0e1fd39e4cfaefe9021920 (diff) |
email: cleanup expired auth codes
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); + } } |