Skip to content

Commit 2f61543

Browse files
committed
refactor : opened 상태인 경우, 모델 과사용을 대비해 delay 추가
1 parent 9e3369a commit 2f61543

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

src/main/kotlin/com/project/codereview/core/service/CodeReviewService.kt

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,15 @@ class CodeReviewService(
3434

3535
private val logger = LoggerFactory.getLogger(CodeReviewService::class.java)
3636

37-
fun review(
37+
suspend fun review(
3838
payload: GithubPayload,
39-
fileContexts: List<ReviewContext>
39+
fileContexts: List<ReviewContext>,
40+
isOpened: Boolean = true
4041
) {
41-
CoroutineScope(Dispatchers.IO).launch {
42-
runReviewTasks(payload, fileContexts)
42+
// Summary 모델 사용 후 최소 시간 대기
43+
if (isOpened) {
44+
delay(ONE_MINUTE_TO_MS)
4345
}
44-
}
45-
46-
private suspend fun runReviewTasks(
47-
payload: GithubPayload,
48-
fileContexts: List<ReviewContext>
49-
) {
5046
val pr = payload.pull_request
5147

5248
val tasks = fileContexts

0 commit comments

Comments
 (0)