You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2024/02/20 15:47:24 UTC

(shardingsphere) branch master updated: Refactor ShardingSphereMetaData (#30214)

This is an automated email from the ASF dual-hosted git repository.

zhaojinchao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 90075fe29f6 Refactor ShardingSphereMetaData (#30214)
90075fe29f6 is described below

commit 90075fe29f62a1b949301acef904fa476e9fd017
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Tue Feb 20 23:47:18 2024 +0800

    Refactor ShardingSphereMetaData (#30214)
---
 .../apache/shardingsphere/infra/metadata/ShardingSphereMetaData.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/ShardingSphereMetaData.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/ShardingSphereMetaData.java
index 8a8e6d5a2f7..486573a373e 100644
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/ShardingSphereMetaData.java
+++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/ShardingSphereMetaData.java
@@ -111,7 +111,7 @@ public final class ShardingSphereMetaData {
         String databaseName = database.getName();
         globalRuleMetaData.findRules(ResourceHeldRule.class).forEach(each -> each.closeStaleResource(databaseName));
         database.getRuleMetaData().findRules(ResourceHeldRule.class).forEach(each -> each.closeStaleResource(databaseName));
-        database.getRuleMetaData().findSingleRule(StaticDataSourceContainedRule.class).ifPresent(StaticDataSourceContainedRule::cleanStorageNodeDataSources);
+        database.getRuleMetaData().findRules(StaticDataSourceContainedRule.class).forEach(StaticDataSourceContainedRule::cleanStorageNodeDataSources);
         Optional.ofNullable(database.getResourceMetaData())
                 .ifPresent(optional -> optional.getStorageUnits().values().forEach(each -> new DataSourcePoolDestroyer(each.getDataSource()).asyncDestroy()));
     }