mirror of
https://github.com/eiblog/eiblog.git
synced 2026-02-23 06:32:28 +08:00
fix: ping func
This commit is contained in:
@@ -48,7 +48,6 @@ blogapp:
|
|||||||
feedrurl: https://deepzz.superfeedr.com/
|
feedrurl: https://deepzz.superfeedr.com/
|
||||||
pingrpc:
|
pingrpc:
|
||||||
- http://ping.baidu.com/ping/RPC2
|
- http://ping.baidu.com/ping/RPC2
|
||||||
- http://blogsearch.google.com/ping/RPC2
|
|
||||||
- http://rpc.pingomatic.com/
|
- http://rpc.pingomatic.com/
|
||||||
# 数据初始化操作,可到博客后台修改
|
# 数据初始化操作,可到博客后台修改
|
||||||
account:
|
account:
|
||||||
|
|||||||
3
pkg/cache/cache.go
vendored
3
pkg/cache/cache.go
vendored
@@ -469,7 +469,8 @@ func (c *Cache) loadOrInit() error {
|
|||||||
if i > 0 {
|
if i > 0 {
|
||||||
v.Prev = articles[i-1]
|
v.Prev = articles[i-1]
|
||||||
}
|
}
|
||||||
if articles[i+1].ID >= blogapp.General.StartID {
|
if i < len(articles)-1 &&
|
||||||
|
articles[i+1].ID >= blogapp.General.StartID {
|
||||||
v.Next = articles[i+1]
|
v.Next = articles[i+1]
|
||||||
}
|
}
|
||||||
c.readdArticle(v, false)
|
c.readdArticle(v, false)
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ func handleAPIPostCreate(c *gin.Context) {
|
|||||||
logrus.Error("handleAPIPostCreate.UpdateArticle: ", err)
|
logrus.Error("handleAPIPostCreate.UpdateArticle: ", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !artc.IsDraft {
|
if !article.IsDraft {
|
||||||
cache.Ei.RepArticle(artc, article)
|
cache.Ei.RepArticle(artc, article)
|
||||||
// 异步执行,快
|
// 异步执行,快
|
||||||
go func() {
|
go func() {
|
||||||
|
|||||||
@@ -40,7 +40,18 @@ func newRequest(method, rawurl string, data interface{}) (*http.Request, error)
|
|||||||
// 获取主机IP
|
// 获取主机IP
|
||||||
host, port, err := net.SplitHostPort(u.Host)
|
host, port, err := net.SplitHostPort(u.Host)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
addrErr := err.(*net.AddrError)
|
||||||
|
if addrErr.Err != "missing port in address" {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
// set default value
|
||||||
|
host = originHost
|
||||||
|
switch u.Scheme {
|
||||||
|
case "http":
|
||||||
|
port = "80"
|
||||||
|
case "https":
|
||||||
|
port = "443"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ips, err := net.LookupHost(host)
|
ips, err := net.LookupHost(host)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user