From 4b77e1f4a771ea202f29b69711095892f5634748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=88=E8=BD=A9?= Date: Fri, 2 May 2025 13:31:35 +0800 Subject: [PATCH] fix(notify): init topic action and resource (#22478) --- pkg/notify/models/topic.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/notify/models/topic.go b/pkg/notify/models/topic.go index 289630343d..82874c449d 100644 --- a/pkg/notify/models/topic.go +++ b/pkg/notify/models/topic.go @@ -391,7 +391,9 @@ func (sm *STopicManager) InitializeData() error { return errors.Wrapf(err, "unable to update topic %s", topic.Name) } } - if isNew { + acnt := TopicActionManager.Query().Equals("topic_id", topic.Id).Count() + rcnt := TopicResourceManager.Query().Equals("topic_id", topic.Id).Count() + if isNew || acnt == 0 || rcnt == 0 { initTopicElement(name, t) } }