From 664922028305e0dd3319ec522ca95533b7e91178 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 25 Jan 2023 22:46:29 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20v2.7.1-dev2=E6=9C=AA=E5=90=AF=E7=94=A8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=90=8C=E6=AD=A5=E9=80=80=E5=87=BA=E6=97=B6?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=90=8C=E6=AD=A5=E5=A4=B1=E8=B4=A5=20Fix=20?= =?UTF-8?q?https://github.com/siyuan-note/siyuan/issues/7164?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/conf.go | 10 ++++++---- kernel/model/sync.go | 5 ----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/kernel/model/conf.go b/kernel/model/conf.go index e0c57b9f6..b27c07d53 100644 --- a/kernel/model/conf.go +++ b/kernel/model/conf.go @@ -399,10 +399,12 @@ func Close(force bool, execInstallPkg int) (exitCode int) { WaitForWritingFiles() if !force { - syncData(false, true, false) - if 0 != ExitSyncSucc { - exitCode = 1 - return + if Conf.Sync.Enabled && ((IsSubscriber() && conf.ProviderSiYuan == Conf.Sync.Provider) || conf.ProviderSiYuan != Conf.Sync.Provider) { + syncData(false, true, false) + if 0 != ExitSyncSucc { + exitCode = 1 + return + } } } diff --git a/kernel/model/sync.go b/kernel/model/sync.go index bac54db5a..ff2ff2309 100644 --- a/kernel/model/sync.go +++ b/kernel/model/sync.go @@ -91,7 +91,6 @@ func BootSyncData() { } func SyncData(boot, exit, byHand bool) { - util.BroadcastByType("main", "syncing", 0, Conf.Language(81), nil) syncData(boot, exit, byHand) } @@ -161,10 +160,6 @@ func checkSync(boot, exit, byHand bool) bool { return false } - if !cloud.IsValidCloudDirName(Conf.Sync.CloudName) { - return false - } - if util.IsMutexLocked(&syncLock) { logging.LogWarnf("sync is in progress") planSyncAfter(30 * time.Second)