# distributed-scheduling-spring-boot-starter **Repository Path**: yzj894811087/distributed-scheduling-spring-boot-starter ## Basic Information - **Project Name**: distributed-scheduling-spring-boot-starter - **Description**: 定时任务分布式增强处理 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-12-08 - **Last Updated**: 2023-02-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 使用 先决条件:配置 redis 。 使用方法:引入注解 `@EnableDistributedScheduling` 即可生效。 ```java @EnableDistributedScheduling @SpringBootApplication public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } } ``` ## 说明 * 增强 Spring `@Scheduled` 注解,使其支持分布式的定时调度。服务有多个实例的情况下,不同实例之间不会重复执行相同的定时任务。 * `@NonDistributed` 不参与分布式处理。 * 如果需要使用`@Scheduled` 注解内使用`${run.timer}`写法时,需要在配置文件中设置。 ```yaml spring: main: allow-circular-references: true ```