fixed #6,发布文章异步提交,随机 session key等

This commit is contained in:
henry.chen
2018-02-09 13:50:34 +08:00
parent 051b034e51
commit 5ae76f243e
6 changed files with 86 additions and 50 deletions

34
api.go
View File

@@ -231,12 +231,15 @@ func apiPostAdd(c *gin.Context) {
}
cid = int(artc.ID)
if !artc.IsDraft {
// elastic
ElasticIndex(artc)
// rss
DoPings(slug)
// disqus
ThreadCreate(artc)
// 异步执行,快
go func() {
// elastic
ElasticIndex(artc)
// rss
DoPings(slug)
// disqus
ThreadCreate(artc)
}()
}
return
}
@@ -260,14 +263,17 @@ func apiPostAdd(c *gin.Context) {
}
if !artc.IsDraft {
ReplaceArticle(a, artc)
// elastic
ElasticIndex(artc)
// rss
DoPings(slug)
// disqus
if a == nil {
ThreadCreate(artc)
}
// 异步执行,快
go func() {
// elastic
ElasticIndex(artc)
// rss
DoPings(slug)
// disqus
if a == nil {
ThreadCreate(artc)
}
}()
}
}