fixed redis cache leak issue

This commit is contained in:
strawmanbobi
2025-06-03 13:05:57 +08:00
parent f84bd13f85
commit f00d088078
6 changed files with 7 additions and 59 deletions

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/private-server.iml" filepath="$PROJECT_DIR$/private-server.iml" />
</modules>
</component>
</project>

View File

@@ -8,6 +8,7 @@ import org.springframework.stereotype.Repository;
import javax.annotation.PostConstruct;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
* Filename: IDecodeSessionRepositoryImpl.java
@@ -38,6 +39,7 @@ public class DecodeSessionRepositoryImpl implements IDecodeSessionRepository {
public void add(final String decodeSessionId, Integer binaryId) {
hashOperations.put(KEY, decodeSessionId, binaryId);
redisTemplate.expire(decodeSessionId, 7 , TimeUnit.DAYS);
}
public void delete(String decodeSessionId) {

View File

@@ -10,6 +10,7 @@ import org.springframework.stereotype.Repository;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
* Filename: IIRBinaryRepositoryImpl.java
@@ -41,6 +42,7 @@ public class IRBinaryRepositoryImpl implements IIRBinaryRepository {
public void add(Integer id, RemoteIndex remoteIndex) {
hashOperations.put(KEY, id, remoteIndex);
redisTemplate.expire(Integer.toString(id), 7 , TimeUnit.DAYS);
}
public void delete(final Integer id) {

View File

@@ -8,6 +8,7 @@ import org.springframework.stereotype.Repository;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.concurrent.TimeUnit;
/**
* Filename: UserAppRepositoryImpl.java
@@ -39,6 +40,7 @@ public class UserAppRepositoryImpl implements IUserAppRepository {
public void add(Integer id, String token) {
hashOperations.put(KEY, token, id);
redisTemplate.expire(token, 7 , TimeUnit.DAYS);
}
public void delete(final String token) {