1
0

fix: 修复schedule注解参数错误

This commit is contained in:
2024-11-03 16:12:05 +08:00
parent 79a1e94f6b
commit a89f4ab8b1
2 changed files with 2 additions and 4 deletions

View File

@@ -14,7 +14,6 @@ import dev.failsafe.FailsafeException
import dev.failsafe.RetryPolicy import dev.failsafe.RetryPolicy
import dev.failsafe.function.CheckedSupplier import dev.failsafe.function.CheckedSupplier
import jakarta.annotation.Resource import jakarta.annotation.Resource
import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicLong import java.util.concurrent.atomic.AtomicLong
import kotlin.time.Duration.Companion.seconds import kotlin.time.Duration.Companion.seconds
import kotlin.time.toJavaDuration import kotlin.time.toJavaDuration
@@ -42,7 +41,7 @@ class NewsRunner : Runner {
@Resource @Resource
private lateinit var management: Management private lateinit var management: Management
@Scheduled(cron = "0 0 * * * ?", initialDelay = 1, timeUnit = TimeUnit.MINUTES) @Scheduled(cron = "0 0 * * * ?")
override fun run() { override fun run() {
sites.forEach { site -> sites.forEach { site ->
logger.info("站点: {}", site.name) logger.info("站点: {}", site.name)

View File

@@ -3,7 +3,6 @@ package com.lanyuanxiaoyao.digtal.market.runner
import com.lanyuanxiaoyao.digtal.market.ArticleRepository import com.lanyuanxiaoyao.digtal.market.ArticleRepository
import com.lanyuanxiaoyao.digtal.market.sender.DingtalkSender import com.lanyuanxiaoyao.digtal.market.sender.DingtalkSender
import jakarta.annotation.Resource import jakarta.annotation.Resource
import java.util.concurrent.TimeUnit
import org.slf4j.LoggerFactory import org.slf4j.LoggerFactory
import org.springframework.scheduling.annotation.Scheduled import org.springframework.scheduling.annotation.Scheduled
import org.springframework.stereotype.Service import org.springframework.stereotype.Service
@@ -15,7 +14,7 @@ class PushRunner : Runner {
@Resource @Resource
private lateinit var articleRepository: ArticleRepository private lateinit var articleRepository: ArticleRepository
@Scheduled(cron = "0 0 0,6,12,18 * * ?", initialDelay = 1, timeUnit = TimeUnit.MINUTES) @Scheduled(cron = "0 0 0,6,12,18 * * ?")
override fun run() { override fun run() {
val articles = articleRepository.findAll { root, _, builder -> val articles = articleRepository.findAll { root, _, builder ->
builder.or( builder.or(