mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-04 14:41:47 +01:00
♻️ 重构内核代理设置 Fix https://github.com/siyuan-note/siyuan/issues/5380
This commit is contained in:
parent
2880222bc6
commit
70b8a7d8eb
16 changed files with 89 additions and 93 deletions
|
|
@ -27,7 +27,7 @@ var cachedRhyResult = map[string]interface{}{}
|
|||
var rhyResultCacheTime int64
|
||||
var rhyResultLock = sync.Mutex{}
|
||||
|
||||
func GetRhyResult(force bool, proxyURL string) (map[string]interface{}, error) {
|
||||
func GetRhyResult(force bool) (map[string]interface{}, error) {
|
||||
rhyResultLock.Lock()
|
||||
defer rhyResultLock.Unlock()
|
||||
|
||||
|
|
@ -36,7 +36,7 @@ func GetRhyResult(force bool, proxyURL string) (map[string]interface{}, error) {
|
|||
return cachedRhyResult, nil
|
||||
}
|
||||
|
||||
request := httpclient.NewCloudRequest(proxyURL)
|
||||
request := httpclient.NewCloudRequest()
|
||||
_, err := request.SetResult(&cachedRhyResult).Get(AliyunServer + "/apis/siyuan/version?ver=" + Ver)
|
||||
if nil != err {
|
||||
LogErrorf("get version meta info failed: %s", err)
|
||||
|
|
|
|||
|
|
@ -327,7 +327,7 @@ func checkPort() {
|
|||
|
||||
LogInfof("port [%s] is opened, try to check version of running kernel", ServerPort)
|
||||
result := NewResult()
|
||||
_, err := httpclient.NewBrowserRequest("").
|
||||
_, err := httpclient.NewBrowserRequest().
|
||||
SetResult(result).
|
||||
SetHeader("User-Agent", UserAgent).
|
||||
Get("http://127.0.0.1:" + ServerPort + "/api/system/version")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue