This commit is contained in:
2026-04-01 14:35:56 +09:00
parent 5ba71f37c0
commit 05a9d01bba
5 changed files with 102 additions and 115 deletions
@@ -282,7 +282,13 @@ object AutoTradingManager {
}
.onFailure {
println("매수 실패: ${it.message} ${stockCode} $orderQty $finalPrice")
TradingLogStore.addLog(decision,"BUY",it.message ?: "매수 실패")
if (it.message?.contains("주문가능금액을 초과") == true) {
AutoTradingManager.addToReanalysis(RankingStock(mksc_shrn_iscd = stockCode,hts_kor_isnm = stockName))
TradingLogStore.addLog(decision,"BUY","${it.message ?: " 매수 실패"} => 재분석 대기열에 추가")
} else {
TradingLogStore.addLog(decision,"BUY",it.message ?: "매수 실패")
}
}
}
}
+1 -11
View File
@@ -107,10 +107,6 @@ object BrowserManager {
}
object DynamicNewsScraper {
// private val playwright by lazy { Playwright.create() }
// private val browser by lazy {
// playwright.chromium().launch(BrowserType.LaunchOptions().setHeadless(true))
// }
fun extractSmartContentWithLineFilter(page: Page): String {
val script = """
@@ -273,13 +269,7 @@ object SafeScraper {
private val totalRam = HardwareDetector.getTotalRamGb()
// RAM 8GB당 1개 수준으로 설정하되, 최대 10~12개로 제한 (CPU 부하 방지)
private val maxParallel = when {
totalRam >= 128 -> 8
totalRam >= 64 -> 6
totalRam >= 32 -> 4
totalRam >= 16 -> 2
else -> 1
}
private val maxParallel = totalRam.div(6).toInt()
// 동시 처리를 1개로 줄여서 안정성을 극대화 (추천)
// Playwright는 여러 페이지를 띄울 때 CPU/메모리 점유율이 매우 높습니다.