From 3bbdf470110b02e641a4df845afdc57939dc1ead Mon Sep 17 00:00:00 2001 From: lunaticbum Date: Mon, 30 Mar 2026 17:00:39 +0900 Subject: [PATCH] ... --- src/main/kotlin/Main.kt | 22 ++++++++++++++++------ src/main/kotlin/network/RagService.kt | 2 +- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/Main.kt b/src/main/kotlin/Main.kt index fb5d130..8ede798 100644 --- a/src/main/kotlin/Main.kt +++ b/src/main/kotlin/Main.kt @@ -99,13 +99,23 @@ private var isAppStarted = false fun main() = application { if (!isAppStarted) { initLogger(DETAILLOG) - val (port1, port2) = PortFinder.findAvailablePortPair(18080) + try { + val (port1, port2) = PortFinder.findAvailablePortPair(18080, false) + if (port1 > 18000 && port2 > port1) { + println("πŸš€ AI μ„œλ²„μš© 포트 ν• λ‹Ή μ™„λ£Œ: 메인($port1), μ„œλΈŒ($port2)") + LLM_PORT = port1 + EMBEDDING_PORT = port2 - println("πŸš€ AI μ„œλ²„μš© 포트 ν• λ‹Ή μ™„λ£Œ: 메인($port1), μ„œλΈŒ($port2)") - LLM_PORT = port1 - EMBEDDING_PORT = port2 - - isAppStarted = true + isAppStarted = true + } else { + println("πŸš€ AI μ„œλ²„μš© 포트 ν• λ‹Ή μ‹€νŒ¨") + exitApplication() + } + } catch (e: Exception) { + println("πŸš€ AI μ„œλ²„μš© 포트 ν• λ‹Ή μ—λŸ¬ : ${e.message}") + e.printStackTrace() + exitApplication() + } } val trayState = rememberTrayState() diff --git a/src/main/kotlin/network/RagService.kt b/src/main/kotlin/network/RagService.kt index c20b953..87d280f 100644 --- a/src/main/kotlin/network/RagService.kt +++ b/src/main/kotlin/network/RagService.kt @@ -249,7 +249,7 @@ object RagService { println("βœ… [$stockName] 전체 뢄석 μ™„λ£Œ 총 μ†Œμš”: ${totalDuration}ms") // 상세 둜그 남기기 - TradingLogStore.addAnalyzer(stockName, stockCode, "λΆ„μ„μ‹œκ°„ 상세: 재무(${financialDuration}ms), λ‰΄μŠ€(${newsIngestDuration}ms), RAG(${ragDuration}ms), AI(${aiDecisionDuration}ms)", true) + TradingLogStore.addAnalyzer(stockName, stockCode, "λΆ„μ„μ‹œκ°„ 상세: 재무(${financialDuration}ms), λ‰΄μŠ€(${newsIngestDuration}ms), RAG(${ragDuration}ms), AI(${aiDecisionDuration}ms), 전체 뢄석 μ™„λ£Œ(${totalDuration}ms)", true) result(finalDecision, true) } else {