|
|
|
@ -22,13 +22,13 @@ import org.springframework.security.oauth2.config.annotation.web.configuration.A
@@ -22,13 +22,13 @@ import org.springframework.security.oauth2.config.annotation.web.configuration.A
|
|
|
|
|
public class TokenStoreAutoCleanScheduleConfiguration { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 每小时执行一致,避免 redis zset 容量问题 |
|
|
|
|
* 每天凌晨执行清除,避免 redis zSet 容量问题 |
|
|
|
|
*/ |
|
|
|
|
@Scheduled(cron = "@hourly") |
|
|
|
|
@Scheduled(cron = "0 0 0 * * ?") |
|
|
|
|
public void doMaintenance() { |
|
|
|
|
KiccRedisTokenStore tokenStore = SpringContextHolderUtil.getBean(KiccRedisTokenStore.class); |
|
|
|
|
long maintenance = tokenStore.doMaintenance(); |
|
|
|
|
log.debug("清理Redis ZADD 过期 token 数量: {}", maintenance); |
|
|
|
|
log.debug("清理 Redis 过期 token 数量: {}", maintenance); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|