This commit is contained in:
2026-03-30 17:00:39 +09:00
parent cab381645c
commit 3bbdf47011
2 changed files with 17 additions and 7 deletions
+16 -6
View File
@@ -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()