File tree Expand file tree Collapse file tree 3 files changed +12
-10
lines changed
java/com/example/log4u/domain/map/cache/dao Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 2424public class ClusterCacheDao {
2525
2626 private static final String CLUSTER_CACHE_KEY = "cluster:geohash:%s:level:%d" ;
27- public static final String CLUSTER_LOCK_KEY = "cluster-lock" ;
27+ public static final String CLUSTER_LOCK_KEY = "cluster-lock:%s " ;
2828
2929 private final CacheManager cacheManager ;
3030
@@ -48,7 +48,7 @@ private List<DiaryClusterResponseDto> convertToClusters(String value) {
4848 }
4949
5050 public List <DiaryClusterResponseDto > loadAndCache (String geohash , int level ) {
51- return distributedLockExecutor .runWithLock (CLUSTER_LOCK_KEY , () -> {
51+ return distributedLockExecutor .runWithLock (CLUSTER_LOCK_KEY . formatted ( geohash ) , () -> {
5252 List <DiaryClusterResponseDto > clusters = loadClustersFromDb (geohash , level );
5353 cache (clusters , geohash , level );
5454 return clusters ;
Original file line number Diff line number Diff line change 2525public class MarkerCacheDao {
2626
2727 private static final String MARKER_CACHE_KEY = "marker:geohash:%s" ;
28- public static final String MARKER_LOCK_KEY = "marker-lock" ;
28+ private static final String MARKER_LOCK_KEY = "marker-lock:%s " ;
2929
3030 private final CacheManager cacheManager ;
3131
@@ -49,11 +49,11 @@ private List<DiaryMarkerResponseDto> convertToMarkers(String value) {
4949 }
5050
5151 public List <DiaryMarkerResponseDto > loadAndCache (String geohash ) {
52- return distributedLockExecutor .runWithLock (MARKER_LOCK_KEY , () -> {
53- List <DiaryMarkerResponseDto > markers = loadMarkersFromDb (geohash );
54- cache (markers , geohash );
55- return markers ;
56- });
52+ return distributedLockExecutor .runWithLock (MARKER_LOCK_KEY . formatted ( geohash ) , () -> {
53+ List <DiaryMarkerResponseDto > markers = loadMarkersFromDb (geohash );
54+ cache (markers , geohash );
55+ return markers ;
56+ });
5757 }
5858
5959 private List <DiaryMarkerResponseDto > loadMarkersFromDb (String geohash ) {
Original file line number Diff line number Diff line change @@ -2,13 +2,15 @@ management:
22 endpoints :
33 web :
44 exposure :
5- include : health, metrics
5+ include : health, metrics, prometheus
66 endpoint :
77 metrics :
88 enabled : true
9+ prometheus :
10+ enabled : true
911 metrics :
1012 tags :
11- application : log4u
13+ application : log4u
1214
1315spring :
1416 datasource :
You can’t perform that action at this time.
0 commit comments