mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-14 19:18:06 +01:00
🎨 同步创建数据快照失败 https://github.com/siyuan-note/siyuan/issues/6106
This commit is contained in:
parent
57b3373df1
commit
421a80071f
3 changed files with 15 additions and 1 deletions
|
|
@ -681,6 +681,18 @@ func indexRepoBeforeCloudSync(repo *dejavu.Repo) (err error) {
|
|||
index, err := repo.Index("[Sync] Cloud sync", map[string]interface{}{
|
||||
eventbus.CtxPushMsg: eventbus.CtxPushMsgToStatusBar,
|
||||
})
|
||||
if errors.Is(err, dejavu.ErrNotFoundObject) {
|
||||
resetErr := os.RemoveAll(filepath.Join(repo.Path))
|
||||
if nil != resetErr {
|
||||
logging.LogErrorf("reset data repo failed: %s", resetErr)
|
||||
return
|
||||
}
|
||||
logging.LogWarnf("data repo has been reset caused by not found object")
|
||||
index, err = repo.Index("[Sync] Cloud sync", map[string]interface{}{
|
||||
eventbus.CtxPushMsg: eventbus.CtxPushMsgToStatusBar,
|
||||
})
|
||||
}
|
||||
|
||||
if nil != err {
|
||||
msg := fmt.Sprintf(Conf.Language(140), formatErrorMsg(err))
|
||||
util.PushStatusBar(msg)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue