spring-task.xml
1.79 KB
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task.xsd">
<!-- 任务执行器 -->
<task:executor id="asyncExecutor" pool-size="5" />
<!-- 任务调度器 -->
<task:scheduler id="asyncScheduler" pool-size="10" />
<!--开启注解调度支持 @Async @Scheduled-->
<task:annotation-driven executor="asyncExecutor"
scheduler="asyncScheduler" />
<!-- 启动定时器
<task:scheduled-tasks scheduler="crawScheduler" > -->
<!-- 爬取天猫中带有sku的商品脚本
<task:scheduled ref="crawlerTmallSKUProductTask" method="run" cron=" 15 15 * * * ? " />-->
<!-- <task:scheduled ref="crawlerTmallSKUProductTask" method="run" cron=" 15 * * * * ? " /> -->
<!-- 爬取48小时未更新的商品脚本
<task:scheduled ref="crawlerUnmodifiedProductTask" method="run" cron=" 15 45 * * * ? " />-->
<!-- <task:scheduled ref="crawlerUnmodifiedProductTask" method="run" cron=" 15 * * * * ? " /> -->
<!-- 每天7点同步天猫商品上下架状态
<task:scheduled ref="tmallProductStatusUpdateTask" method="run" cron=" 0 0 5,8,11,14,17,20 * * ? " />-->
<!-- <task:scheduled ref="tmallProductStatusUpdateTask" method="run" cron=" 0 0/2 * * * ? " /> -->
<!--</task:scheduled-tasks>-->
</beans>