File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
backend/src/main/java/io/f1/backend Expand file tree Collapse file tree 2 files changed +8
-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 .ApplicationArguments ;
7+ import org .springframework .boot .ApplicationRunner ;
58import org .springframework .context .annotation .Bean ;
69import org .springframework .context .annotation .Configuration ;
710import org .springframework .data .redis .connection .RedisConnectionFactory ;
@@ -38,4 +41,9 @@ public RedisMessageListenerContainer redisMessageListenerContainer(
3841 container .addMessageListener (redisUserSubscriber , new PatternTopic ("user-*" ));
3942 return container ;
4043 }
44+
45+ @ Bean
46+ ApplicationRunner redisWarmingRunner (StatRepositoryAdapter statRepositoryAdapter ) {
47+ return args -> statRepositoryAdapter .setup ();
48+ }
4149}
You can’t perform that action at this time.
0 commit comments