fix: 修复schedule注解参数错误
This commit is contained in:
@@ -14,7 +14,6 @@ import dev.failsafe.FailsafeException
|
||||
import dev.failsafe.RetryPolicy
|
||||
import dev.failsafe.function.CheckedSupplier
|
||||
import jakarta.annotation.Resource
|
||||
import java.util.concurrent.TimeUnit
|
||||
import java.util.concurrent.atomic.AtomicLong
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
import kotlin.time.toJavaDuration
|
||||
@@ -42,7 +41,7 @@ class NewsRunner : Runner {
|
||||
@Resource
|
||||
private lateinit var management: Management
|
||||
|
||||
@Scheduled(cron = "0 0 * * * ?", initialDelay = 1, timeUnit = TimeUnit.MINUTES)
|
||||
@Scheduled(cron = "0 0 * * * ?")
|
||||
override fun run() {
|
||||
sites.forEach { site ->
|
||||
logger.info("站点: {}", site.name)
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.lanyuanxiaoyao.digtal.market.runner
|
||||
import com.lanyuanxiaoyao.digtal.market.ArticleRepository
|
||||
import com.lanyuanxiaoyao.digtal.market.sender.DingtalkSender
|
||||
import jakarta.annotation.Resource
|
||||
import java.util.concurrent.TimeUnit
|
||||
import org.slf4j.LoggerFactory
|
||||
import org.springframework.scheduling.annotation.Scheduled
|
||||
import org.springframework.stereotype.Service
|
||||
@@ -15,7 +14,7 @@ class PushRunner : Runner {
|
||||
@Resource
|
||||
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() {
|
||||
val articles = articleRepository.findAll { root, _, builder ->
|
||||
builder.or(
|
||||
|
||||
Reference in New Issue
Block a user