status-update jar 로직 추가

This commit is contained in:
2026-03-05 11:12:51 +09:00
parent 0e288777fe
commit e833173756
330 changed files with 10641 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
package com.kamco.cd.kamcoback.config;
import java.util.concurrent.Callable;
import java.util.concurrent.Semaphore;
import org.springframework.stereotype.Component;
@Component
public class ApiCallLimiter {
// 동시에 허용할 외부 API 호출 수
private final Semaphore semaphore = new Semaphore(5);
public <T> T call(Callable<T> fn) {
try {
semaphore.acquire();
return fn.call();
} catch (Exception e) {
throw new RuntimeException(e);
} finally {
semaphore.release();
}
}
}