File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
src/main/java/com/haru/api/infra/redis Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ public class RedisReportConsumer {
2424 private String QUEUE_KEY ;
2525 private static final long BATCH_SIZE = 20 ;
2626
27- @ Transactional
2827 @ Scheduled (cron = "0 0/5 * * * *" ) // 정각부터 5분 마다 실행
2928 public void pollQueueEvery30Minutes () {
3029 long now = Instant .now ().getEpochSecond ();
@@ -37,7 +36,7 @@ public void pollQueueEvery30Minutes() {
3736
3837 for (String id : dueIds ) {
3938 // Worker Queue로 push
40- redisTemplate .opsForList ().leftPush ("report-worker-queue " , id );
39+ redisTemplate .opsForList ().leftPush ("REPORT_WORKER_QUEUE " , id );
4140 // ZSET에서는 제거
4241 redisTemplate .opsForZSet ().remove (QUEUE_KEY , id );
4342 }
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ public class ReportWorker {
1919 private final MoodTrackerReportService reportService ;
2020 private final ExecutorService executor = Executors .newFixedThreadPool (5 ); // 5개 병렬 Worker
2121
22- private static final String WORKER_QUEUE = "report-worker-queue " ;
22+ private static final String WORKER_QUEUE = "REPORT_WORKER_QUEUE " ;
2323
2424 @ Scheduled (fixedDelay = 2000 ) // 2초마다 큐 확인
2525 public void consumeTasks () {
@@ -44,7 +44,7 @@ private void process(Long moodTrackerId) {
4444 redisTemplate .opsForList ().leftPush (WORKER_QUEUE , moodTrackerId .toString ());
4545 } else {
4646 log .error ("재시도 한계 초과, 실패 큐로 이동: {}" , moodTrackerId );
47- redisTemplate .opsForList ().leftPush ("report-failed-queue " , moodTrackerId .toString ());
47+ redisTemplate .opsForList ().leftPush ("REPORT_FAILED_QUEUE " , moodTrackerId .toString ());
4848 }
4949 }
5050 }
You can’t perform that action at this time.
0 commit comments