🎨 Improve kernel stability by eliminating some data races https://github.com/siyuan-note/siyuan/issues/9842

This commit is contained in:
Daniel 2023-12-08 21:46:46 +08:00
parent f9d476ebf5
commit 1d54de679f
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
7 changed files with 83 additions and 62 deletions

View file

@ -84,7 +84,7 @@ func Export2Liandi(id string) (err error) {
request := httpclient.NewCloudRequest30s()
resp, getErr := request.
SetSuccessResult(result).
SetCookies(&http.Cookie{Name: "symphony", Value: Conf.User.UserToken}).
SetCookies(&http.Cookie{Name: "symphony", Value: Conf.GetUser().UserToken}).
Get(util.GetCloudAccountServer() + "/api/v2/article/update/" + articleId)
if nil != getErr {
logging.LogErrorf("get liandi article info failed: %s", getErr)
@ -114,7 +114,7 @@ func Export2Liandi(id string) (err error) {
title := path.Base(tree.HPath)
tags := tree.Root.IALAttr("tags")
content := exportMarkdownContent0(tree, util.GetCloudForumAssetsServer()+time.Now().Format("2006/01")+"/siyuan/"+Conf.User.UserId+"/", true,
content := exportMarkdownContent0(tree, util.GetCloudForumAssetsServer()+time.Now().Format("2006/01")+"/siyuan/"+Conf.GetUser().UserId+"/", true,
4, 1, 0,
"#", "#",
"", "",
@ -123,7 +123,7 @@ func Export2Liandi(id string) (err error) {
request := httpclient.NewCloudRequest30s()
request = request.
SetSuccessResult(result).
SetCookies(&http.Cookie{Name: "symphony", Value: Conf.User.UserToken}).
SetCookies(&http.Cookie{Name: "symphony", Value: Conf.GetUser().UserToken}).
SetBody(map[string]interface{}{
"articleTitle": title,
"articleTags": tags,
@ -1090,7 +1090,7 @@ func ExportStdMarkdown(id string) string {
cloudAssetsBase := ""
if IsSubscriber() {
cloudAssetsBase = util.GetCloudAssetsServer() + Conf.User.UserId + "/"
cloudAssetsBase = util.GetCloudAssetsServer() + Conf.GetUser().UserId + "/"
}
return exportMarkdownContent0(tree, cloudAssetsBase, false,
Conf.Export.BlockRefMode, Conf.Export.BlockEmbedMode, Conf.Export.FileAnnotationRefMode,