mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
!535 feat: EasyRetry-v3.2.0 => SnailJob-v1.0.0beta1
* feat: EasyRetry-v3.2.0 => SnailJob-v1.0.0beta1
This commit is contained in:
@ -22,18 +22,14 @@
|
||||
<artifactId>spring-boot-autoconfigure</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- EasyRetry client -->
|
||||
<!-- SnailJob client -->
|
||||
<dependency>
|
||||
<groupId>com.aizuda</groupId>
|
||||
<artifactId>easy-retry-client-starter</artifactId>
|
||||
<artifactId>snail-job-client-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aizuda</groupId>
|
||||
<artifactId>easy-retry-client-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aizuda</groupId>
|
||||
<artifactId>easy-retry-client-job-core</artifactId>
|
||||
<artifactId>snail-job-client-job-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@ -3,9 +3,9 @@ package org.dromara.common.job.config;
|
||||
import ch.qos.logback.classic.Logger;
|
||||
import ch.qos.logback.classic.LoggerContext;
|
||||
import ch.qos.logback.classic.spi.ILoggingEvent;
|
||||
import com.aizuda.easy.retry.client.common.appender.EasyRetryLogbackAppender;
|
||||
import com.aizuda.easy.retry.client.common.event.EasyRetryStartingEvent;
|
||||
import com.aizuda.easy.retry.client.starter.EnableEasyRetry;
|
||||
import com.aizuda.snailjob.client.common.appender.SnailLogbackAppender;
|
||||
import com.aizuda.snailjob.client.common.event.SnailClientStartingEvent;
|
||||
import com.aizuda.snailjob.client.starter.EnableSnailJob;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@ -15,20 +15,20 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
/**
|
||||
* 启动定时任务
|
||||
*
|
||||
* @author dhb52
|
||||
* @since 2024/3/12
|
||||
* @author opensnail
|
||||
* @date 2024-05-17
|
||||
*/
|
||||
@AutoConfiguration
|
||||
@ConditionalOnProperty(prefix = "easy-retry", name = "enabled", havingValue = "true")
|
||||
@ConditionalOnProperty(prefix = "snail-job", name = "enabled", havingValue = "true")
|
||||
@EnableScheduling
|
||||
@EnableEasyRetry(group = "${easy-retry.group-name}")
|
||||
public class EasyRetryConfig {
|
||||
@EnableSnailJob(group = "${snail-job.group-name}")
|
||||
public class SnailJobConfig {
|
||||
|
||||
@EventListener(EasyRetryStartingEvent.class)
|
||||
public void onStarting(EasyRetryStartingEvent event) {
|
||||
@EventListener(SnailClientStartingEvent.class)
|
||||
public void onStarting(SnailClientStartingEvent event) {
|
||||
LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
|
||||
EasyRetryLogbackAppender<ILoggingEvent> ca = new EasyRetryLogbackAppender<>();
|
||||
ca.setName("easy_log_appender");
|
||||
SnailLogbackAppender<ILoggingEvent> ca = new SnailLogbackAppender<>();
|
||||
ca.setName("snail_log_appender");
|
||||
ca.start();
|
||||
Logger rootLogger = lc.getLogger(Logger.ROOT_LOGGER_NAME);
|
||||
rootLogger.addAppender(ca);
|
@ -1 +1 @@
|
||||
org.dromara.common.job.config.EasyRetryConfig
|
||||
org.dromara.common.job.config.SnailJobConfig
|
||||
|
Reference in New Issue
Block a user