From bf0e52fc01e84e67d44feb77beddc0534b76f6aa Mon Sep 17 00:00:00 2001 From: WrBug Date: Sat, 14 Feb 2026 07:33:34 +0800 Subject: [PATCH] =?UTF-8?q?chore(cryptotail):=20=E7=A7=BB=E9=99=A4=20Crypt?= =?UTF-8?q?oTailStrategyScheduler=EF=BC=8CrunCycle=20=E6=9C=AA=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=E4=B8=94=E8=A7=A6=E5=8F=91=E7=94=B1=20WS=20=E8=B4=9F?= =?UTF-8?q?=E8=B4=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- .../cryptotail/CryptoTailStrategyScheduler.kt | 37 ------------------- 1 file changed, 37 deletions(-) delete mode 100644 backend/src/main/kotlin/com/wrbug/polymarketbot/service/cryptotail/CryptoTailStrategyScheduler.kt diff --git a/backend/src/main/kotlin/com/wrbug/polymarketbot/service/cryptotail/CryptoTailStrategyScheduler.kt b/backend/src/main/kotlin/com/wrbug/polymarketbot/service/cryptotail/CryptoTailStrategyScheduler.kt deleted file mode 100644 index 66080e0..0000000 --- a/backend/src/main/kotlin/com/wrbug/polymarketbot/service/cryptotail/CryptoTailStrategyScheduler.kt +++ /dev/null @@ -1,37 +0,0 @@ -package com.wrbug.polymarketbot.service.cryptotail - -import com.wrbug.polymarketbot.event.CryptoTailStrategyChangedEvent -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.SupervisorJob -import kotlinx.coroutines.launch -import kotlinx.coroutines.runBlocking -import org.slf4j.LoggerFactory -import org.springframework.context.event.EventListener -import org.springframework.stereotype.Component - -/** - * 尾盘策略:策略创建/更新/启用后立即触发一轮检查(由 WebSocket 订单簿持续监听,此处仅做创建/更新后的一次补充)。 - */ -@Component -class CryptoTailStrategyScheduler( - private val executionService: CryptoTailStrategyExecutionService -) { - - private val logger = LoggerFactory.getLogger(CryptoTailStrategyScheduler::class.java) - - private val scope = CoroutineScope(Dispatchers.Default + SupervisorJob()) - - @EventListener - fun onStrategyChanged(event: CryptoTailStrategyChangedEvent) { - scope.launch { - try { - runBlocking { - executionService.runCycle() - } - } catch (e: Exception) { - logger.error("尾盘策略变更后立即执行异常: ${e.message}", e) - } - } - } -}