File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
backend/src/main/java/io/f1/backend Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 1010import io .f1 .backend .global .exception .errorcode .RoomErrorCode ;
1111import io .f1 .backend .global .exception .errorcode .UserErrorCode ;
1212
13- import jakarta .annotation .PostConstruct ;
14-
1513import lombok .RequiredArgsConstructor ;
1614import lombok .extern .slf4j .Slf4j ;
1715
@@ -30,7 +28,6 @@ public class StatRepositoryAdapter implements StatRepository {
3028 private final StatJpaRepository jpaRepository ;
3129 private final StatRedisRepository redisRepository ;
3230
33- @ PostConstruct
3431 public void setup () {
3532 redisRepository .setup ();
3633 warmingRedis ();
Original file line number Diff line number Diff line change 11package io .f1 .backend .global .config ;
22
3+ import io .f1 .backend .domain .stat .dao .StatRepositoryAdapter ;
34import io .f1 .backend .global .util .RedisUserSubscriber ;
45
6+ import org .springframework .boot .ApplicationRunner ;
57import org .springframework .context .annotation .Bean ;
68import org .springframework .context .annotation .Configuration ;
79import org .springframework .data .redis .connection .RedisConnectionFactory ;
@@ -38,4 +40,9 @@ public RedisMessageListenerContainer redisMessageListenerContainer(
3840 container .addMessageListener (redisUserSubscriber , new PatternTopic ("user-*" ));
3941 return container ;
4042 }
43+
44+ @ Bean
45+ ApplicationRunner redisWarmingRunner (StatRepositoryAdapter statRepositoryAdapter ) {
46+ return args -> statRepositoryAdapter .setup ();
47+ }
4148}
You can’t perform that action at this time.
0 commit comments