mirror of
https://github.com/eiblog/eiblog.git
synced 2026-02-11 17:02:27 +08:00
fixed #6,发布文章异步提交,随机 session key等
This commit is contained in:
34
api.go
34
api.go
@@ -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)
|
||||
}
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user