场景
当某些简单的定时任务需要通过后台修改执行时间时,通过spring boot自带的定时任务来实现是个不错的选择。
代码实现
创建定时任务类
需要实现SchedulingConfigurer接口
1 |
|
通过接口触发修改执行时间
1 |
|
- 本文作者: reiner
- 本文链接: https://reiner.host/posts/1230.html
- 版权声明: 转载请注明出处,并附上原文链接
分享个人经验见解
缺失模块。
1、请确保node版本大于6.2
2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
npm i hexo-generator-json-content --save
3、在根目录_config.yml里添加配置:
jsonContent:
meta: false
pages: false
posts:
title: true
date: true
path: true
text: false
raw: false
content: false
slug: false
updated: false
comments: false
link: false
permalink: false
excerpt: false
categories: false
tags: true