From 72efb13d0d69155feefed3317ef4cb8a7f5ef3a2 Mon Sep 17 00:00:00 2001 From: 3y Date: Fri, 5 May 2023 20:51:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=85=A5=20hades=20=E5=8D=87=E7=BA=A7?= =?UTF-8?q?v1.0.4=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constant/OfficialAccountParamConstant.java | 2 +- .../austin/handler/script/impl/YunPianSmsScript.java | 7 +++++-- .../austin/support/pending/AbstractLazyPending.java | 12 +++++++----- austin-web/src/main/resources/application.properties | 7 +++---- pom.xml | 6 +++--- 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/austin-common/src/main/java/com/java3y/austin/common/constant/OfficialAccountParamConstant.java b/austin-common/src/main/java/com/java3y/austin/common/constant/OfficialAccountParamConstant.java index 048707d..e6f4a4d 100644 --- a/austin-common/src/main/java/com/java3y/austin/common/constant/OfficialAccountParamConstant.java +++ b/austin-common/src/main/java/com/java3y/austin/common/constant/OfficialAccountParamConstant.java @@ -39,7 +39,7 @@ public class OfficialAccountParamConstant { /** * 扫码/关注后/取消关注后的服务号文案 */ - public static final String SUBSCRIBE_TIPS = "项目群还有少量名额,添加我的微信 sanwai3y 备注【项目】,我会拉入项目群"; + public static final String SUBSCRIBE_TIPS = "项目群还有少量名额,添加我的微信 java3yyy 备注【项目】,我会拉入官方项目交流群"; public static final String SCAN_TIPS = "咋又扫码啦?重新关注一波吧!"; public static final String UNSUBSCRIBE_TIPS = "老乡别走!"; diff --git a/austin-handler/src/main/java/com/java3y/austin/handler/script/impl/YunPianSmsScript.java b/austin-handler/src/main/java/com/java3y/austin/handler/script/impl/YunPianSmsScript.java index 72b85f5..7ba8bd3 100644 --- a/austin-handler/src/main/java/com/java3y/austin/handler/script/impl/YunPianSmsScript.java +++ b/austin-handler/src/main/java/com/java3y/austin/handler/script/impl/YunPianSmsScript.java @@ -16,8 +16,9 @@ import com.java3y.austin.handler.domain.sms.YunPianSendResult; import com.java3y.austin.handler.script.SmsScript; import com.java3y.austin.support.domain.SmsRecord; import com.java3y.austin.support.utils.AccountUtils; -import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -28,9 +29,11 @@ import java.util.*; * @date 2022年5月23日 * 发送短信接入文档:https://www.yunpian.com/official/document/sms/zh_CN/domestic_list */ -@Slf4j @Component("YunPianSmsScript") public class YunPianSmsScript implements SmsScript { + + private static Logger log = LoggerFactory.getLogger(YunPianSmsScript.class); + @Autowired private AccountUtils accountUtils; diff --git a/austin-support/src/main/java/com/java3y/austin/support/pending/AbstractLazyPending.java b/austin-support/src/main/java/com/java3y/austin/support/pending/AbstractLazyPending.java index e3d6075..d913667 100644 --- a/austin-support/src/main/java/com/java3y/austin/support/pending/AbstractLazyPending.java +++ b/austin-support/src/main/java/com/java3y/austin/support/pending/AbstractLazyPending.java @@ -56,6 +56,12 @@ public abstract class AbstractLazyPending { tasks.add(obj); } + // 判断是否停止当前线程 + if (stop && CollUtil.isEmpty(tasks)) { + executorService.shutdown(); + break; + } + // 处理条件:1. 数量超限 2. 时间超限 if (CollUtil.isNotEmpty(tasks) && dataReady()) { List taskRef = tasks; @@ -66,11 +72,7 @@ public abstract class AbstractLazyPending { pendingParam.getExecutorService().execute(() -> this.handle(taskRef)); } - // 判断是否停止当前线程 - if (stop && CollUtil.isEmpty(tasks)) { - executorService.shutdown(); - break; - } + } catch (Exception e) { log.error("Pending#initConsumePending failed:{}", Throwables.getStackTraceAsString(e)); } diff --git a/austin-web/src/main/resources/application.properties b/austin-web/src/main/resources/application.properties index e5e7695..0baef2c 100644 --- a/austin-web/src/main/resources/application.properties +++ b/austin-web/src/main/resources/application.properties @@ -85,7 +85,7 @@ apollo.bootstrap.namespaces=${austin.default.apollo.namespace:boss.austin},dynam nacos.config.server-addr=${austin.nacos.addr.ip:austin-nacos}:${austin.nacos.addr.port:8848} nacos.config.username=${austin.nacos.username:nacos} nacos.config.password=${austin.nacos.password:nacos} -nacos.config.namespace=${austin.nacos.namespace:60e2b165-d830-4163-a0e9-b97ec2f7164c} +nacos.config.namespace=${austin.nacos.namespace:hades} nacos.config.enabled=${austin.nacos.enabled} nacos.data-id=${austin.nacos.dataId:austin} @@ -93,9 +93,8 @@ nacos.group=${austin.nacos.group:DEFAULT_GROUP} ########################################## nacos end ########################################## ########################################## rule Engine start ########################################## -hades.main.config.enabled=${austin.rule.engine.enabled:false} -hades.main.config.file-name=${austin.rule.engine.file-name:hades} -hades.main.config.group-name=${austin.rule.engine.group-name:hades} +hades.enabled=${austin.rule.engine.enabled:false} +hades.config-name=${austin.rule.engine.file-name:hades} ########################################## rule Engine end ########################################## ########################################## log start ########################################## diff --git a/pom.xml b/pom.xml index 88a700d..7692650 100644 --- a/pom.xml +++ b/pom.xml @@ -218,17 +218,17 @@ 2.2.2 - + io.github.ZhongFuCheng3y hades-nacos-starter - 1.0.3 + 1.0.4 - +