diff --git a/src/main/kotlin/service/AutoTradingManager.kt b/src/main/kotlin/service/AutoTradingManager.kt index 6ae4af5..02bb3cc 100644 --- a/src/main/kotlin/service/AutoTradingManager.kt +++ b/src/main/kotlin/service/AutoTradingManager.kt @@ -942,7 +942,7 @@ object AutoTradingManager { checkBalance() lastForceCheckMinute = currentMinute // 실행 완료 기록 } - } else if (((now.hour == 8 && KisSession.tradeConfig.before_nxt) || (now.hour >= 16 && now.hour < 20 && KisSession.tradeConfig.after_nxt)) && (currentMinute % 2 == 1)) { + } else if (((now.hour == 8 && KisSession.tradeConfig.before_nxt && currentMinute < 45) || (now.hour >= 16 && now.hour < 20 && KisSession.tradeConfig.after_nxt)) && (currentMinute % 2 == 1)) { if (lastForceCheckMinute != currentMinute) { TradingLogStore.addAnalyzer( " - ", diff --git a/src/main/kotlin/service/DynamicNewsScraper.kt b/src/main/kotlin/service/DynamicNewsScraper.kt index f9cbf5c..a61892b 100644 --- a/src/main/kotlin/service/DynamicNewsScraper.kt +++ b/src/main/kotlin/service/DynamicNewsScraper.kt @@ -291,7 +291,7 @@ object SafeScraper { private val totalRam = HardwareDetector.getTotalRamGb() // RAM 8GB당 1개 수준으로 설정하되, 최대 10~12개로 제한 (CPU 부하 방지) - private val maxParallel = totalRam.div(6).toInt() + private val maxParallel = totalRam.div(4).toInt() // 동시 처리를 1개로 줄여서 안정성을 극대화 (추천) // Playwright는 여러 페이지를 띄울 때 CPU/메모리 점유율이 매우 높습니다. diff --git a/src/main/kotlin/service/SystemSleepPreventer.kt b/src/main/kotlin/service/SystemSleepPreventer.kt index a7c8196..9f9e1a8 100644 --- a/src/main/kotlin/service/SystemSleepPreventer.kt +++ b/src/main/kotlin/service/SystemSleepPreventer.kt @@ -82,22 +82,12 @@ object SystemSleepPreventer { } if (process?.isAlive == true) return - if (!isWin) { -// try { -// // -i: 시스템 절전 방지, -d: 디스플레이 취침 방지, -m: 디스크 유휴 상태 방지 -// val command = listOf("caffeinate", "-i", "-d", "-m") -// process = ProcessBuilder(command).start() -// println("☕ [System] caffeinate 실행됨: 앱이 켜져 있는 동안 절전 모드가 방지됩니다.") -// } catch (e: Exception) { -// println("⚠️ [System] caffeinate 실행 실패: ${e.message}") -// } - } + start2() } fun start2() { println("🚀 화면 잠금 방지 프로그램이 시작되었습니다. (작동 시간: $startTime ~ $endTime)") - // 1분(60초)마다 체크 scheduler.scheduleAtFixedRate({ if (isWorkingTime()) { @@ -105,7 +95,7 @@ object SystemSleepPreventer { } else { println("💤 현재는 휴식 시간입니다. (${LocalTime.now().withNano(0)})") } - }, 0, 60 * 2, TimeUnit.SECONDS) + }, 0, 150, TimeUnit.SECONDS) } private fun isWorkingTime(): Boolean { @@ -136,21 +126,6 @@ object SystemSleepPreventer { private val osName = System.getProperty("os.name").lowercase() - // 설정 시간 - private val dimTime = LocalTime.of(16, 0) // 오후 4시 이후 최저 밝기 - - fun start3() { - scheduler.scheduleAtFixedRate({ - val now = LocalTime.now() - - // 16:00 이후라면 밝기를 낮춤 - if (now.isAfter(dimTime) || now.isBefore(LocalTime.of(8, 30))) { - setBrightness(0) - } else { - setBrightness(100) // 업무 시간에는 다시 밝게 (80%) - } - }, 0, 10, TimeUnit.MINUTES) // 10분마다 체크 - } private fun setBrightness(level: Int) { try {