This commit is contained in:
2026-03-27 18:03:06 +09:00
parent 62e408230e
commit d552584446
3 changed files with 66 additions and 6 deletions
+13 -4
View File
@@ -54,6 +54,7 @@ import service.TradingDecisionCallback
import ui.DashboardScreen
import ui.SettingsScreen
import ui.TradingDecisionLog
import util.PortFinder
// 화면 상태 정의
enum class AppScreen { Settings, Dashboard, TradingDecision }
@@ -94,13 +95,21 @@ fun initLogger(isDebug: Boolean) {
println("🤫 운영 모드: 에러 로그만 출력합니다.")
}
}
private var isAppStarted = false
fun main() = application {
initLogger(DETAILLOG)
if (!isAppStarted) {
initLogger(DETAILLOG)
val (port1, port2) = PortFinder.findAvailablePortPair(18080)
println("🚀 AI 서버용 포트 할당 완료: 메인($port1), 서브($port2)")
LLM_PORT = port1
EMBEDDING_PORT = port2
isAppStarted = true
}
val trayState = rememberTrayState()
var isWindowOpen by remember { mutableStateOf(false) } // 창의 표시 상태 관리
LaunchedEffect(Unit) {
SystemSleepPreventer.start()
AutoTradingManager.startBackgroundScheduler()