From 945a400df7ada577e5975ea25c22ad2522c4b663 Mon Sep 17 00:00:00 2001 From: lanyuanxiaoyao Date: Mon, 4 Nov 2024 18:51:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4=E9=87=87=E9=9B=86?= =?UTF-8?q?=E6=97=B6=E9=97=B4=EF=BC=8C=E5=8D=8A=E5=A4=9C=E4=B8=8D=E7=94=A8?= =?UTF-8?q?=E9=87=87=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kotlin/com/lanyuanxiaoyao/digtal/market/Application.kt | 3 ++- .../com/lanyuanxiaoyao/digtal/market/runner/NewsRunner.kt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/lanyuanxiaoyao/digtal/market/Application.kt b/src/main/kotlin/com/lanyuanxiaoyao/digtal/market/Application.kt index eb4f76e..b256783 100644 --- a/src/main/kotlin/com/lanyuanxiaoyao/digtal/market/Application.kt +++ b/src/main/kotlin/com/lanyuanxiaoyao/digtal/market/Application.kt @@ -20,6 +20,7 @@ import org.springframework.context.ApplicationListener import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.context.event.ContextClosedEvent +import org.springframework.scheduling.annotation.EnableScheduling import org.springframework.web.servlet.config.annotation.CorsRegistry import org.springframework.web.servlet.config.annotation.WebMvcConfigurer @@ -40,7 +41,7 @@ data class MailProperties @ConstructorBinding constructor( val targets: List, ) -// @EnableScheduling +@EnableScheduling @OptIn(ExperimentalStdlibApi::class) @ConfigurationPropertiesScan @SpringBootApplication diff --git a/src/main/kotlin/com/lanyuanxiaoyao/digtal/market/runner/NewsRunner.kt b/src/main/kotlin/com/lanyuanxiaoyao/digtal/market/runner/NewsRunner.kt index e98988c..880b869 100644 --- a/src/main/kotlin/com/lanyuanxiaoyao/digtal/market/runner/NewsRunner.kt +++ b/src/main/kotlin/com/lanyuanxiaoyao/digtal/market/runner/NewsRunner.kt @@ -44,7 +44,7 @@ class NewsRunner : Runner { @Resource private lateinit var management: Management - @Scheduled(cron = "0 0 * * * ?") + @Scheduled(cron = "0 0 6-18 * * ?") override fun run() { sites.forEach { site -> logger.info("站点: {}", site.name)