Skip to content

Commit

Permalink
release v1.1.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
yanhom1314 committed Sep 8, 2024
2 parents ca6a699 + 566f728 commit 3577bd6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
12 changes: 7 additions & 5 deletions core/src/main/java/org/dromara/dynamictp/core/DtpRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executor;
import java.util.stream.Collectors;

import static java.util.stream.Collectors.toList;
import static org.dromara.dynamictp.common.constant.DynamicTpConst.M_1;
import static org.dromara.dynamictp.common.constant.DynamicTpConst.PROPERTIES_CHANGE_SHOW_STYLE;

Expand Down Expand Up @@ -185,7 +187,7 @@ public static void refresh(DtpExecutorProps props) {
private static void refresh(ExecutorWrapper executorWrapper, DtpExecutorProps props) {
if (props.coreParamIsInValid()) {
log.error("DynamicTp refresh, invalid parameters exist, properties: {}", props);
throw new IllegalArgumentException("DynamicTp refresh, invalid parameters exist, properties: " + props);
return;
}
TpMainFields oldFields = ExecutorConverter.toMainFields(executorWrapper);
doRefresh(executorWrapper, props);
Expand Down Expand Up @@ -331,7 +333,7 @@ private static void updateQueueProps(ExecutorAdapter<?> executor, DtpExecutorPro

@Override
protected void onContextRefreshedEvent(ContextRefreshedEvent event) {
List<DtpExecutorProps> executors = dtpProperties.getExecutors();
List<DtpExecutorProps> executors = Optional.ofNullable(dtpProperties.getExecutors()).orElse(Collections.emptyList());
Set<String> remoteExecutors = Collections.emptySet();
if (CollectionUtils.isNotEmpty(executors)) {
remoteExecutors = executors.stream()
Expand All @@ -342,9 +344,9 @@ protected void onContextRefreshedEvent(ContextRefreshedEvent event) {
val localExecutors = CollectionUtils.subtract(registeredExecutors, remoteExecutors);

// refresh just for non-dtp executors
executors = executors.stream().filter(e -> !e.isDtp()).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(executors)) {
executors.forEach(DtpRegistry::refresh);
val nonDtpExecutors = executors.stream().filter(e -> !e.isDtp()).collect(toList());
if (CollectionUtils.isNotEmpty(nonDtpExecutors)) {
nonDtpExecutors.forEach(DtpRegistry::refresh);
}
log.info("DtpRegistry has been initialized, remote executors: {}, local executors: {}",
remoteExecutors, localExecutors);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public class DtpBannerPrinter implements EnvironmentAware {

private static final String SITE = " :: https://dynamictp.cn ::";

private static final String GITHUB_REPO = " :: https://github.com/dromara/dynamic-tp ::";

private static final String GITEE_REPO = " :: https://gitee.com/dromara/dynamic-tp ::";

private static final String BANNER = "\n" +
"| __ \\ (_) |__ __| \n" +
"| | | |_ _ _ __ __ _ _ __ ___ _ ___| |_ __ \n" +
Expand All @@ -47,10 +51,10 @@ public class DtpBannerPrinter implements EnvironmentAware {

@Override
public void setEnvironment(Environment environment) {
boolean enable = environment.getProperty(DynamicTpConst.BANNER_ENABLED_PROP,
boolean.class, true);
boolean enable = environment.getProperty(DynamicTpConst.BANNER_ENABLED_PROP, boolean.class, true);
if (enable) {
log.info(BANNER + "\n" + NAME + "\n :: " + VersionUtil.getVersion() + " :: \n" + SITE + "\n");
log.info(BANNER + "\n" + NAME + "\n :: {} :: \n" + SITE + "\n" + GITHUB_REPO + "\n" + GITEE_REPO,
VersionUtil.getVersion());
}
}
}
2 changes: 1 addition & 1 deletion dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<url>https://github.com/yanhom1314/dynamic-tp</url>

<properties>
<revision>1.1.8-3.x</revision>
<revision>1.1.8.1-3.x</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<maven.compiler.source>17</maven.compiler.source>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<url>https://github.com/yanhom1314/dynamic-tp</url>

<properties>
<revision>1.1.8-3.x</revision>
<revision>1.1.8.1-3.x</revision>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>

Expand Down

0 comments on commit 3577bd6

Please sign in to comment.