..
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
import androidx.compose.runtime.mutableStateListOf
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.SupervisorJob
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.serialization.Serializable
|
||||
import model.AppConfig
|
||||
import model.TradingDecision
|
||||
import network.NewsService
|
||||
import org.jetbrains.exposed.sql.*
|
||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
|
||||
import org.jetbrains.exposed.sql.javatime.datetime
|
||||
import org.jetbrains.exposed.sql.transactions.experimental.suspendedTransactionAsync
|
||||
import org.jetbrains.exposed.sql.transactions.transaction
|
||||
import report.TradingReportManager
|
||||
import report.TradingReportService
|
||||
@@ -509,11 +515,21 @@ object TradingLogStore {
|
||||
decisionLogs.add(
|
||||
LogEntry(
|
||||
time = LocalTime.now().format(DateTimeFormatter.ofPattern("HH:mm:ss")),
|
||||
stockName = "${tradingDecision.stockName}[${tradingDecision.currentPrice}][]",
|
||||
stockName = "${tradingDecision.stockName}[${tradingDecision.currentPrice}]",
|
||||
decision = decision,
|
||||
confidence = tradingDecision.confidence,
|
||||
reason = log
|
||||
)
|
||||
).apply {
|
||||
CoroutineScope(Dispatchers.Default).launch {
|
||||
println("CALLED sendTelegramMessage -1")
|
||||
if (decision.contains("WATCH") || ((tradingDecision.investmentGrade?.ordinal
|
||||
?: 0) < 2)
|
||||
) {
|
||||
println("CALLED sendTelegramMessage OK")
|
||||
NewsService.sendTelegramMessage("${this@apply.decision} ${tradingDecision.stockName}[${tradingDecision.currentPrice}] ${log}")
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -545,8 +561,14 @@ object TradingLogStore {
|
||||
decision = "NOTICE",
|
||||
confidence = 100.0,
|
||||
reason = log
|
||||
)
|
||||
).apply {
|
||||
CoroutineScope(Dispatchers.Default).launch {
|
||||
println("CALLED sendTelegramMessage")
|
||||
NewsService.sendTelegramMessage("${this@apply.decision}$name[$code] ${log}")
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user