Skip to content
Snippets Groups Projects
Unverified Commit ee18dad4 authored by liujian's avatar liujian Committed by GitHub
Browse files

optimize: globalTransactionScanner listener optimize (#3380)

parent 96016f0c
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,7 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
- [[#3359](https://github.com/seata/seata/pull/3359)] 删除未使用的测试用例
- [[#3397](https://github.com/seata/seata/pull/3397)] 添加更改记录文件夹
- [[#3303](https://github.com/seata/seata/pull/3303)] 支持从nacos单一dataId中读取所有配置
- [[#3380](https://github.com/seata/seata/pull/3380)] 优化globalTransactionScanner监听器
......@@ -63,6 +64,7 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
- [anselleeyy](https://github.com/anselleeyy)
- [Ifdevil](https://github.com/Ifdevil)
- [Rubbernecker](https://github.com/Rubbernecker)
- [lj2018110133](https://github.com/lj2018110133)
同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。
......
......@@ -42,6 +42,7 @@
- [[#3359](https://github.com/seata/seata/pull/3359)] remove unused test case
- [[#3397](https://github.com/seata/seata/pull/3397)] add the change records folder
- [[#3303](https://github.com/seata/seata/pull/3303)] supports reading all configurations from a single Nacos dataId
- [[#3380](https://github.com/seata/seata/pull/3380)] globalTransactionScanner listener optimize
### test
......@@ -59,6 +60,7 @@
- [anselleeyy](https://github.com/anselleeyy)
- [Ifdevil](https://github.com/Ifdevil)
- [Rubbernecker](https://github.com/Rubbernecker)
- [lj2018110133](https://github.com/lj2018110133)
Also, we receive many valuable issues, questions and advices from our community. Thanks for you all.
......
......@@ -329,12 +329,12 @@ public class GlobalTransactionScanner extends AbstractAutoProxyCreator
@Override
public void afterPropertiesSet() {
ConfigurationCache.addConfigListener(ConfigurationKeys.DISABLE_GLOBAL_TRANSACTION,
(ConfigurationChangeListener)this);
if (disableGlobalTransaction) {
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Global transaction is disabled.");
}
ConfigurationCache.addConfigListener(ConfigurationKeys.DISABLE_GLOBAL_TRANSACTION,
(ConfigurationChangeListener)this);
return;
}
if (initialized.compareAndSet(false, true)) {
......@@ -351,10 +351,10 @@ public class GlobalTransactionScanner extends AbstractAutoProxyCreator
@Override
public void onChangeEvent(ConfigurationChangeEvent event) {
if (ConfigurationKeys.DISABLE_GLOBAL_TRANSACTION.equals(event.getDataId())) {
LOGGER.info("{} config changed, old value:{}, new value:{}", ConfigurationKeys.DISABLE_GLOBAL_TRANSACTION,
disableGlobalTransaction, event.getNewValue());
disableGlobalTransaction = Boolean.parseBoolean(event.getNewValue().trim());
if (!disableGlobalTransaction && initialized.compareAndSet(false, true)) {
LOGGER.info("{} config changed, old value:{}, new value:{}", ConfigurationKeys.DISABLE_GLOBAL_TRANSACTION,
disableGlobalTransaction, event.getNewValue());
initClient();
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment