diff options
author | 2018-04-12 14:32:44 +0300 | |
---|---|---|
committer | 2018-04-12 14:32:44 +0300 | |
commit | c5649915e6259e921cfd087042525b69533d53b0 (patch) | |
tree | 54e2d7bdba8a21a640b3e2a0c427b72d33c445c2 /juick-notifications/src/main/java/com/juick/components/CleanUp.java | |
parent | 9e5a6b3f2f6907f18f22718bcb6f0ac7f79c95cd (diff) |
notifications: pushserver is the only websocket component for now
Diffstat (limited to 'juick-notifications/src/main/java/com/juick/components/CleanUp.java')
-rw-r--r-- | juick-notifications/src/main/java/com/juick/components/CleanUp.java | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/juick-notifications/src/main/java/com/juick/components/CleanUp.java b/juick-notifications/src/main/java/com/juick/components/CleanUp.java deleted file mode 100644 index d0f3e44a..00000000 --- a/juick-notifications/src/main/java/com/juick/components/CleanUp.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.juick.components; - -import com.juick.components.service.TokenService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import javax.inject.Inject; -import java.util.ArrayList; - -/** - * Created by vitalyster on 22.11.2016. - */ -@Component -public class CleanUp { - - private static Logger logger = LoggerFactory.getLogger(CleanUp.class); - - @Inject - TokenService tokenService; - - @Inject - Notifications push; - - @Scheduled(fixedRate = 600000) - public void cleanupTokens() { - logger.debug("initializing GCM tokens cleanup: {} tokens", push.getInvalidGCMTokens().size()); - tokenService.deleteTokens("gcm", new ArrayList<>(push.getInvalidGCMTokens())); - push.cleanupGCMTokens(); - logger.debug("initializing MPNS tokens cleanup: {} tokens", push.getInvalidMPNSTokens().size()); - tokenService.deleteTokens("mpns", new ArrayList<>(push.getInvalidMPNSTokens())); - push.cleanupMPNSTokens(); - logger.debug("initializing APNS tokens cleanup: {} tokens", push.getInvalidAPNSTokens().size()); - tokenService.deleteTokens("apns", new ArrayList<>(push.getInvalidAPNSTokens())); - push.cleanupMPNSTokens(); - } -} |