...
This commit is contained in:
parent
b9ba8efc1a
commit
4c27d71701
@ -942,7 +942,7 @@ object AutoTradingManager {
|
|||||||
checkBalance()
|
checkBalance()
|
||||||
lastForceCheckMinute = currentMinute // 실행 완료 기록
|
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) {
|
if (lastForceCheckMinute != currentMinute) {
|
||||||
TradingLogStore.addAnalyzer(
|
TradingLogStore.addAnalyzer(
|
||||||
" - ",
|
" - ",
|
||||||
|
|||||||
@ -291,7 +291,7 @@ object SafeScraper {
|
|||||||
private val totalRam = HardwareDetector.getTotalRamGb()
|
private val totalRam = HardwareDetector.getTotalRamGb()
|
||||||
|
|
||||||
// RAM 8GB당 1개 수준으로 설정하되, 최대 10~12개로 제한 (CPU 부하 방지)
|
// RAM 8GB당 1개 수준으로 설정하되, 최대 10~12개로 제한 (CPU 부하 방지)
|
||||||
private val maxParallel = totalRam.div(6).toInt()
|
private val maxParallel = totalRam.div(4).toInt()
|
||||||
|
|
||||||
// 동시 처리를 1개로 줄여서 안정성을 극대화 (추천)
|
// 동시 처리를 1개로 줄여서 안정성을 극대화 (추천)
|
||||||
// Playwright는 여러 페이지를 띄울 때 CPU/메모리 점유율이 매우 높습니다.
|
// Playwright는 여러 페이지를 띄울 때 CPU/메모리 점유율이 매우 높습니다.
|
||||||
|
|||||||
@ -82,22 +82,12 @@ object SystemSleepPreventer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (process?.isAlive == true) return
|
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()
|
start2()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun start2() {
|
fun start2() {
|
||||||
println("🚀 화면 잠금 방지 프로그램이 시작되었습니다. (작동 시간: $startTime ~ $endTime)")
|
println("🚀 화면 잠금 방지 프로그램이 시작되었습니다. (작동 시간: $startTime ~ $endTime)")
|
||||||
|
|
||||||
// 1분(60초)마다 체크
|
// 1분(60초)마다 체크
|
||||||
scheduler.scheduleAtFixedRate({
|
scheduler.scheduleAtFixedRate({
|
||||||
if (isWorkingTime()) {
|
if (isWorkingTime()) {
|
||||||
@ -105,7 +95,7 @@ object SystemSleepPreventer {
|
|||||||
} else {
|
} else {
|
||||||
println("💤 현재는 휴식 시간입니다. (${LocalTime.now().withNano(0)})")
|
println("💤 현재는 휴식 시간입니다. (${LocalTime.now().withNano(0)})")
|
||||||
}
|
}
|
||||||
}, 0, 60 * 2, TimeUnit.SECONDS)
|
}, 0, 150, TimeUnit.SECONDS)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun isWorkingTime(): Boolean {
|
private fun isWorkingTime(): Boolean {
|
||||||
@ -136,21 +126,6 @@ object SystemSleepPreventer {
|
|||||||
|
|
||||||
private val osName = System.getProperty("os.name").lowercase()
|
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) {
|
private fun setBrightness(level: Int) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user