diff --git a/kernel/model/updater.go b/kernel/model/updater.go index 03d833618..73fe68ceb 100644 --- a/kernel/model/updater.go +++ b/kernel/model/updater.go @@ -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