本文介紹在 Spring Boot 中如何使用定時(shí)任務(wù),使用非常簡單,就不做過多說明了。
com.kfit.base.scheduling.SchedulingConfig:
package com.kfit.base.scheduling;
importorg.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
importorg.springframework.scheduling.annotation.Scheduled;
/**
- 定時(shí)任務(wù)
- @author Administrator
*/
@Configuration
@EnableScheduling
public****class SchedulingConfig {
@Scheduled(cron = "0/20 * ** * ?") // 每20秒執(zhí)行一次
public****void scheduler() {
System. ***out*** .println(">>>>>>>>>SchedulingConfig.scheduler()");
}
}
-
定時(shí)
+關(guān)注
關(guān)注
1文章
124瀏覽量
25916 -
spring
+關(guān)注
關(guān)注
0文章
340瀏覽量
15078 -
Boot
+關(guān)注
關(guān)注
0文章
153瀏覽量
36754
發(fā)布評(píng)論請(qǐng)先 登錄
Spring Boot如何實(shí)現(xiàn)異步任務(wù)
關(guān)于stm32系統(tǒng)定時(shí)任務(wù)的問題
Linux系統(tǒng)定時(shí)任務(wù)Crond
busybox用crontab/crond在嵌入式系統(tǒng)中添加定時(shí)任務(wù)的方法
Spring Boot定時(shí)任務(wù)的重寫方法
SpringBoot如何實(shí)現(xiàn)動(dòng)態(tài)增刪啟停定時(shí)任務(wù)

Python定時(shí)任務(wù)的實(shí)現(xiàn)方式
說說Spring定時(shí)任務(wù)如何大規(guī)模企業(yè)級(jí)運(yùn)用
解析Golang定時(shí)任務(wù)庫gron設(shè)計(jì)和原理
求一種SpringBoot定時(shí)任務(wù)動(dòng)態(tài)管理通用解決方案
Spring Boot中整合兩種定時(shí)任務(wù)的方法

如何動(dòng)態(tài)添加修改刪除定時(shí)任務(wù)?
Linux如何使用cron進(jìn)行定時(shí)任務(wù)的操作
python定時(shí)任務(wù)實(shí)踐

linux定時(shí)任務(wù)的用法總結(jié)

評(píng)論