release: 2026-03-24.4 (캐시 TTL 수정) #183

병합
htlee develop 에서 main 로 2 commits 를 머지했습니다 2026-03-24 14:21:16 +09:00

파일 보기

@ -24,6 +24,9 @@ public class GroupPolygonService {
private final CacheManager cacheManager;
private final ObjectMapper objectMapper;
private static final long CACHE_TTL_MS = 5 * 60_000L; // 5분
private volatile long lastCacheTime = 0;
private static final String LATEST_GROUPS_SQL = """
SELECT group_type, group_key, group_label, snapshot_time,
ST_AsGeoJSON(polygon) AS polygon_geojson,
@ -61,7 +64,9 @@ public class GroupPolygonService {
@SuppressWarnings("unchecked")
public List<GroupPolygonDto> getLatestGroups() {
Cache cache = cacheManager.getCache(CacheConfig.GROUP_POLYGONS);
if (cache != null) {
long now = System.currentTimeMillis();
if (cache != null && (now - lastCacheTime) < CACHE_TTL_MS) {
Cache.ValueWrapper wrapper = cache.get("data");
if (wrapper != null) {
return (List<GroupPolygonDto>) wrapper.get();
@ -72,6 +77,7 @@ public class GroupPolygonService {
if (cache != null) {
cache.put("data", results);
lastCacheTime = now;
}
return results;
}