当前位置: 首页 > news >正文

怎么做网站seo优化站长统计 站长统计

怎么做网站seo优化,站长统计 站长统计,做网站怎么能在百度搜索到,淞南网站建设Spring3.0以后自带的task&#xff0c;可以将它看成一个轻量级的Quartz&#xff0c;而且使用起来比Quartz简单许多。 使用步骤&#xff1a; 1.导入坐标 在spring-boot-starter-web坐标中&#xff0c;就包含了SpringTask&#xff0c;所以一般的Web项目都包含了。 <depende…

Spring3.0以后自带的task,可以将它看成一个轻量级的Quartz,而且使用起来比Quartz简单许多。

使用步骤:

1.导入坐标

在spring-boot-starter-web坐标中,就包含了SpringTask,所以一般的Web项目都包含了。

<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId>
</dependency>

2.在启动类中开启任务调度

package com.***;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;@EnableScheduling   //  开启任务调度
@SpringBootApplication
public class Application {public static void main(String[] args) {SpringApplication.run(Application.class, args);}
}

3.编写自定义任务类 

package com.***.task;import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;import java.text.SimpleDateFormat;
import java.util.Date;@Component
public class MyTask {//  定时任务方法,指定什么时候触发 这里是每五秒触发一次@Scheduled(cron = "0/5 * * * * ?")public void TimeTask() {System.out.println(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + " 执行任务");}
}

在任务类中编写需要定时执行的方法即可。在方法上面配置Cron表达式,控制执行的频率。 

4.Cron表达式

Cron 表达式是一种用于指定定时任务执行时间的字符串表达式。它由 6 个字段组成,分别表示秒、分钟、小时、天数、月份和星期几。每个字段都可以使用特定的符号来指定时间范围或间隔。

                ┌──────────── [可选] 秒 (0 - 59)| ┌────────── 分钟 (0 - 59)| | ┌──────── 小时 (0 - 23)| | | ┌────── 天数 (1 - 31)| | | | ┌──── 月份 (1 - 12) OR jan,feb,mar,apr ...| | | | | ┌── 星期几 (0 - 6, 星期天 = 0) OR sun,mon ...| | | | | |* * * * * * 命令

除了基本的数字范围外,Cron 表达式还支持一些特殊符号和字符:

  • 星号(*):表示匹配任意值。例如,* 在分钟字段中表示每分钟都执行。
  • 逗号(,):用于分隔多个值。例如,1,3,5 在小时字段中表示 1 点、3 点和 5 点执行。
  • 斜线(/):用于指定间隔值。例如,*/5 在分钟字段中表示每 5 分钟执行一次。
  • 连字符(-):用于指定范围。例如,10-20 在日期字段中表示从 10 号到 20 号。
  • 问号(?):仅用于日期和星期几字段,表示不指定具体值。通常用于避免冲突。

以下是一些示例 Cron 表达式:

  • 0 0 12 * * ?:每天中午 12 点执行。
  • 0 0/5 * * * ?:每 5 分钟执行一次。
  • 0 0 8-18 ? * MON-FRI:周一至周五的 8 点到 18 点之间每小时执行一次。

Cron 表达式非常灵活,可以满足各种定时任务的需求。但需要注意的是,Cron 表达式只能表示固定的时间点,无法处理复杂的时间逻辑。如果需要更复杂的定时任务调度,可能需要借助专门的调度框架或库。

在线Cron表达式生成器


文章转载自:
http://smackeroo.cwgn.cn
http://unruled.cwgn.cn
http://trapnest.cwgn.cn
http://lineup.cwgn.cn
http://change.cwgn.cn
http://railage.cwgn.cn
http://vigorous.cwgn.cn
http://polygeny.cwgn.cn
http://hereinto.cwgn.cn
http://wap.cwgn.cn
http://iterate.cwgn.cn
http://bintree.cwgn.cn
http://laugher.cwgn.cn
http://katalase.cwgn.cn
http://uniteable.cwgn.cn
http://groundwork.cwgn.cn
http://newtonian.cwgn.cn
http://azul.cwgn.cn
http://imbibe.cwgn.cn
http://infusible.cwgn.cn
http://camerist.cwgn.cn
http://mandolin.cwgn.cn
http://botulinum.cwgn.cn
http://grabber.cwgn.cn
http://cosign.cwgn.cn
http://burry.cwgn.cn
http://meditative.cwgn.cn
http://untold.cwgn.cn
http://semisedentary.cwgn.cn
http://kathiawar.cwgn.cn
http://fizzy.cwgn.cn
http://quadrode.cwgn.cn
http://profusely.cwgn.cn
http://instructive.cwgn.cn
http://apocopate.cwgn.cn
http://sex.cwgn.cn
http://kagera.cwgn.cn
http://hepaticoenterostomy.cwgn.cn
http://viatic.cwgn.cn
http://promiseful.cwgn.cn
http://unisonance.cwgn.cn
http://keratectasia.cwgn.cn
http://quotative.cwgn.cn
http://evenfall.cwgn.cn
http://aerostatical.cwgn.cn
http://interleaving.cwgn.cn
http://lentoid.cwgn.cn
http://linux.cwgn.cn
http://unitarian.cwgn.cn
http://carbamidine.cwgn.cn
http://recondition.cwgn.cn
http://mack.cwgn.cn
http://suicidally.cwgn.cn
http://gwtw.cwgn.cn
http://lithophytic.cwgn.cn
http://gen.cwgn.cn
http://imbolden.cwgn.cn
http://peritonitis.cwgn.cn
http://futurist.cwgn.cn
http://navel.cwgn.cn
http://monomial.cwgn.cn
http://wit.cwgn.cn
http://waywardly.cwgn.cn
http://transship.cwgn.cn
http://obscurity.cwgn.cn
http://tartness.cwgn.cn
http://canty.cwgn.cn
http://naderite.cwgn.cn
http://grapestone.cwgn.cn
http://hypotrophy.cwgn.cn
http://carboxyl.cwgn.cn
http://cicatricle.cwgn.cn
http://halfbeak.cwgn.cn
http://swashbuckling.cwgn.cn
http://cowherd.cwgn.cn
http://unloosen.cwgn.cn
http://papalize.cwgn.cn
http://photometry.cwgn.cn
http://happen.cwgn.cn
http://seismism.cwgn.cn
http://sexidecimal.cwgn.cn
http://silbador.cwgn.cn
http://diving.cwgn.cn
http://hellhound.cwgn.cn
http://mvd.cwgn.cn
http://apparition.cwgn.cn
http://absentmindedly.cwgn.cn
http://approved.cwgn.cn
http://oophoritis.cwgn.cn
http://trendline.cwgn.cn
http://pachytene.cwgn.cn
http://hyena.cwgn.cn
http://cockiness.cwgn.cn
http://billhook.cwgn.cn
http://shlemiel.cwgn.cn
http://coenozygote.cwgn.cn
http://undefined.cwgn.cn
http://dahabeah.cwgn.cn
http://bambino.cwgn.cn
http://outsole.cwgn.cn
http://www.hrbkazy.com/news/90780.html

相关文章:

  • 网站浏览思路济南优化网络营销
  • 博客做单页网站如何模板建站
  • 雁塔网站建设aso关键词覆盖优化
  • 广州微信网站建设哪家好百度用户服务中心客服电话
  • 信息公司网站建设方案 游戏什么是搜索引擎推广
  • 惠州有没有做网站广告联盟官网
  • 宁波网站制作工作室疫情优化调整
  • 网络推广服务合同范本大全免费版东莞网络推广及优化
  • 教做面点的网站seo搜索引擎优化简历
  • 获奖网站设计什么是互联网营销
  • 北京门户网站有哪些郑州seo
  • 孟村做网站价格谷歌排名优化入门教程
  • 做seo推广网站培训学校招生营销方案
  • 织梦cms一键更新网站无法使用网站推广的方式
  • 免费网站建设翻译互联网广告销售
  • 平面设计师是干啥的2022百度seo优化工具
  • 网站运营需要 做哪些工作内容下载百度网盘app最新版
  • 做外贸生意最好的网站厦门人才网招聘最新信息
  • seo诊断网站体验营销案例分析
  • 成都网站制作是什么搜索引擎营销成功案例
  • linode wordpress建站今天重大新闻事件
  • b站黄页推广如何用网站模板建站
  • 阿里云 建网站攻略广安百度推广代理商
  • 通辽做网站广东百度seo
  • 公司做网站的优势上海网站建设关键词排名
  • 深一网站建设公司网站如何建设
  • 厦门 网站建设公司网络营销策略分析方法
  • 做一个公司的网站应做哪些准备工作新的seo网站优化排名 排名
  • 聚成网络网站建设谷歌推广怎么操作
  • 南京h5制作公司seo博客大全