From 9841e0b4819e069d483f0258e7da2f9cf2958cf3 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 15 Jun 2023 11:55:36 +0800 Subject: [PATCH] :art: Export data.zip and then import it no longer change the file timestamp Fix https://github.com/siyuan-note/siyuan/issues/8540 --- kernel/model/import.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel/model/import.go b/kernel/model/import.go index 410ed9896..a23869e1e 100644 --- a/kernel/model/import.go +++ b/kernel/model/import.go @@ -82,6 +82,9 @@ func ImportSY(zipPath, boxID, toPath string) (err error) { util.PushEndlessProgress(Conf.Language(73)) defer util.ClearPushProgress(100) + syncLock.Lock() + defer syncLock.Unlock() + baseName := filepath.Base(zipPath) ext := filepath.Ext(baseName) baseName = strings.TrimSuffix(baseName, ext) @@ -412,6 +415,9 @@ func ImportData(zipPath string) (err error) { util.PushEndlessProgress(Conf.Language(73)) defer util.ClearPushProgress(100) + syncLock.Lock() + defer syncLock.Unlock() + baseName := filepath.Base(zipPath) ext := filepath.Ext(baseName) baseName = strings.TrimSuffix(baseName, ext)