Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Improve set publish

Danielf31ba9485cb3
diff --git a/kernel/api/setting.go b/kernel/api/setting.go
index 0943c00f1f..c1b22add91 100644
--- a/kernel/api/setting.go
+++ b/kernel/api/setting.go
@@ -638,15 +638,19 @@ func setPublish(c *gin.Context) {
model.Conf.Publish = publish
model.Conf.Save()
- if port, err := proxy.InitPublishService(); err != nil {
+ port, err := proxy.InitPublishService()
+ if err != nil {
ret.Code = -1
ret.Msg = err.Error()
- } else {
- ret.Data = map[string]any{
- "port": port,
- "publish": model.Conf.Publish,
- }
+ return
}
+
+ ret.Data = map[string]any{
+ "port": port,
+ "publish": model.Conf.Publish,
+ }
+
+ util.BroadcastByType("main", "setPublish", 0, "", model.Conf.Publish)
}
func getPublish(c *gin.Context) {