🎨 桌面端自动下载更新安装包 https://github.com/siyuan-note/siyuan/issues/5837

This commit is contained in:
Liang Ding 2022-09-07 22:49:29 +08:00
parent e2a6780cec
commit 0380971327
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -24,6 +24,7 @@ import (
"os"
"path/filepath"
"runtime"
"sync"
"github.com/88250/gulu"
"github.com/imroc/req/v3"
@ -31,11 +32,20 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
var checkDownloadInstallPkgLock = sync.Mutex{}
func checkDownloadInstallPkg() {
if !Conf.System.DownloadInstallPkg {
return
}
if util.IsMutexLocked(&checkDownloadInstallPkgLock) {
return
}
checkDownloadInstallPkgLock.Lock()
defer checkDownloadInstallPkgLock.Unlock()
result, err := util.GetRhyResult(false)
if nil != err {
return