From 105a4ac4f23485e22f07c8576a0b0c66a2a4cceb Mon Sep 17 00:00:00 2001 From: JamesChenX Date: Sat, 21 Dec 2024 17:36:57 +0800 Subject: [PATCH] Avoding upserting redundant the root admin --- .../server/common/domain/admin/service/BaseAdminService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turms-server-common/src/main/java/im/turms/server/common/domain/admin/service/BaseAdminService.java b/turms-server-common/src/main/java/im/turms/server/common/domain/admin/service/BaseAdminService.java index 7bee63418b..5d8f2dd22d 100644 --- a/turms-server-common/src/main/java/im/turms/server/common/domain/admin/service/BaseAdminService.java +++ b/turms-server-common/src/main/java/im/turms/server/common/domain/admin/service/BaseAdminService.java @@ -82,7 +82,7 @@ protected void loadAndListenAdmins() { for (Admin admin : admins) { if (admin.getRoleIds() .contains(ADMIN_ROLE_ROOT_ID)) { - break; + return Mono.empty(); } } return addRootAdmin().onErrorMap(t -> new RuntimeException(