🎨 同步创建数据快照失败 Fix https://github.com/siyuan-note/siyuan/issues/6106
This commit is contained in:
parent
8cef519539
commit
f3413cb583
8 changed files with 22 additions and 18 deletions
|
@ -809,7 +809,7 @@
|
|||
"20": "Cannot be converted to heading when including sub-documents",
|
||||
"21": "Please enter the captcha",
|
||||
"22": "The captcha is incorrect",
|
||||
"23": "The data repo is corrupted due to external changes (such as using a third-party real-time synchronization disk), please reset the data repo",
|
||||
"23": "The data repo is corrupted, please reset the data repo",
|
||||
"24": "Network timed out, please try again later",
|
||||
"25": "The attribute name only supports English letters and digits",
|
||||
"26": "Please initialize the data repo key first in [Settings - About - Data repo key]",
|
||||
|
@ -891,7 +891,7 @@
|
|||
"102": "Processing completed",
|
||||
"103": "The update installation package has been automatically downloaded in the background. When exiting, you will be asked whether to install the new version",
|
||||
"104": "The update installation package failed to download, please check the network connection",
|
||||
"105": "TODO",
|
||||
"105": "Corrupted data repo have been automatically reset",
|
||||
"106": "TODO",
|
||||
"107": "Moving document [%s]",
|
||||
"108": "Cleaning obsolete indexes...",
|
||||
|
|
|
@ -809,7 +809,7 @@
|
|||
"20": "No se puede convertir en título al incluir subdocumentos",
|
||||
"21": "Por favor ingrese el captcha",
|
||||
"22": "El captcha es incorrecto",
|
||||
"23": "El repositorio de datos está dañado debido a cambios externos (como el uso de un disco de sincronización en tiempo real de terceros), restablezca el repositorio de datos",
|
||||
"23": "El repositorio de datos está dañado, reinicie el repositorio de datos",
|
||||
"24": "Se agotó el tiempo de espera de la red. Vuelva a intentarlo más tarde.",
|
||||
"25": "El nombre del atributo sólo admite letras y dígitos en inglés",
|
||||
"26": "Por favor, inicialice primero la clave de repositorio de datos en [Configuración - Acerca de - Clave de repositorio de datos]",
|
||||
|
@ -891,7 +891,7 @@
|
|||
"102": "Procesamiento completado",
|
||||
"103": "El paquete de instalación de la actualización se ha descargado automáticamente en segundo plano. Al salir, se le preguntará si desea instalar la nueva versión",
|
||||
"104": "El paquete de instalación de la actualización no se pudo descargar, verifique la conexión de red",
|
||||
"105": "TODO",
|
||||
"105": "El repositorio de datos corruptos se ha restablecido automáticamente",
|
||||
"106": "TODO",
|
||||
"107": "Moviendo documento [%s]",
|
||||
"108": "Limpiando índices obsoletos...",
|
||||
|
|
|
@ -809,7 +809,7 @@
|
|||
"20": "Ne peut pas être converti en titre lorsque des sous-documents sont inclus.",
|
||||
"21": "Veuillez entrer le captcha",
|
||||
"22": "Le captcha est incorrect",
|
||||
"23": "Le référentiel de données est endommagé en raison de modifications externes (comme l'utilisation d'un disque de synchronisation en temps réel tiers), veuillez réinitialiser le référentiel de données",
|
||||
"23": "Le référentiel de données est corrompu, veuillez réinitialiser le référentiel de données",
|
||||
"24": "Le réseau a expiré, veuillez réessayer plus tard",
|
||||
"25": "Le nom de l'attribut ne supporte que les lettres et les chiffres anglais.",
|
||||
"26": "Veuillez d'abord initialiser la clé du référentiel de données dans [Paramètres - À propos - Clé du référentiel de données]",
|
||||
|
@ -891,7 +891,7 @@
|
|||
"102": "Traitement terminé",
|
||||
"103": "Le package d'installation de la mise à jour a été automatiquement téléchargé en arrière-plan. En quittant, il vous sera demandé si vous souhaitez installer la nouvelle version",
|
||||
"104": "Le package d'installation de la mise à jour n'a pas pu être téléchargé, veuillez vérifier la connexion réseau",
|
||||
"105": "TODO",
|
||||
"105": "Le référentiel de données corrompu a été automatiquement réinitialisé",
|
||||
"106": "TODO",
|
||||
"107": "Déplacement du document [%s]",
|
||||
"108": "Nettoyage des index obsolètes...",
|
||||
|
|
|
@ -809,7 +809,7 @@
|
|||
"20": "包含子文檔時無法轉換為標題",
|
||||
"21": "請輸入驗證碼",
|
||||
"22": "驗證碼不正確",
|
||||
"23": "數據倉庫因為外部變更損壞(比如使用第三方實時同步盤),請重置數據倉庫",
|
||||
"23": "數據倉庫已被損壞,請重置數據倉庫",
|
||||
"24": "網絡超時,請稍後再試",
|
||||
"25": "屬性名僅支援英文字母和阿拉伯數字",
|
||||
"26": "請先在 [設置 - 關於 - 數據倉庫密鑰] 中初始化數據倉庫密鑰",
|
||||
|
@ -891,7 +891,7 @@
|
|||
"102": "處理完畢",
|
||||
"103": "已經在後台開始自動下載更新安裝包,退出時將詢問是否安裝新版本",
|
||||
"104": "更新安裝包下載失敗,請檢查網絡連接",
|
||||
"105": "TODO",
|
||||
"105": "已經自動重置損壞的數據倉庫",
|
||||
"106": "TODO",
|
||||
"107": "正在移動文檔 [%s]",
|
||||
"108": "正在清理已過時的索引...",
|
||||
|
|
|
@ -809,7 +809,7 @@
|
|||
"20": "包含子文档时无法转换为标题",
|
||||
"21": "请输入验证码",
|
||||
"22": "验证码不正确",
|
||||
"23": "数据仓库因为外部变更损坏(比如使用第三方实时同步盘),请重置数据仓库",
|
||||
"23": "数据仓库已被损坏,请重置数据仓库",
|
||||
"24": "网络超时,请稍后再试",
|
||||
"25": "属性名仅支持英文字母和阿拉伯数字",
|
||||
"26": "请先在 [设置 - 关于 - 数据仓库密钥] 中初始化数据仓库密钥",
|
||||
|
@ -862,7 +862,7 @@
|
|||
"73": "正在导入,请稍等...",
|
||||
"74": "内核尚未完全启动 [%d%%],请稍后再试",
|
||||
"75": "尝试访问文件失败",
|
||||
"76": "数据文件已被其他程序锁定。(如果使用了第三方同步盘,请检查同步状态)",
|
||||
"76": "数据文件已被其他程序锁定。",
|
||||
"77": "不可用的目录路径 [%s]",
|
||||
"78": "新老路径重复",
|
||||
"79": "仅支持导入 Markdown 文档",
|
||||
|
@ -891,7 +891,7 @@
|
|||
"102": "处理完毕",
|
||||
"103": "已经在后台开始自动下载更新安装包,退出时将询问是否安装新版本",
|
||||
"104": "更新安装包下载失败,请检查网络连接",
|
||||
"105": "TODO",
|
||||
"105": "已经自动重置损坏的数据仓库",
|
||||
"106": "TODO",
|
||||
"107": "正在移动文档 [%s]",
|
||||
"108": "正在清理已过时的索引...",
|
||||
|
|
|
@ -37,7 +37,7 @@ require (
|
|||
github.com/patrickmn/go-cache v2.1.0+incompatible
|
||||
github.com/qiniu/go-sdk/v7 v7.13.0
|
||||
github.com/radovskyb/watcher v1.0.7
|
||||
github.com/siyuan-note/dejavu v0.0.0-20221008180903-80366e53821a
|
||||
github.com/siyuan-note/dejavu v0.0.0-20221009014342-57351eb27c75
|
||||
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75
|
||||
github.com/siyuan-note/eventbus v0.0.0-20220916025349-3ac6e75522da
|
||||
github.com/siyuan-note/filelock v0.0.0-20221007163134-7e64809023ef
|
||||
|
|
|
@ -345,10 +345,8 @@ github.com/shurcooL/reactions v0.0.0-20181006231557-f2e0b4ca5b82/go.mod h1:TCR1l
|
|||
github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
|
||||
github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4=
|
||||
github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw=
|
||||
github.com/siyuan-note/dejavu v0.0.0-20220930021019-e62491947339 h1:jePYjiGBPa5Qs8bCdlPDrRzfNxr0FJ+rQYv/d6H5p8A=
|
||||
github.com/siyuan-note/dejavu v0.0.0-20220930021019-e62491947339/go.mod h1:Y+bg0j0Z7C66oJWPPYMs+wZuFeiTRWhh2aLkqctJFKk=
|
||||
github.com/siyuan-note/dejavu v0.0.0-20221008180903-80366e53821a h1:5zn/SFVvih7nwr8bRB9qeZ9NHfjSUA9dneEMqNzsPps=
|
||||
github.com/siyuan-note/dejavu v0.0.0-20221008180903-80366e53821a/go.mod h1:Y+bg0j0Z7C66oJWPPYMs+wZuFeiTRWhh2aLkqctJFKk=
|
||||
github.com/siyuan-note/dejavu v0.0.0-20221009014342-57351eb27c75 h1:4aExF0IlFsBj+54knKzWfr+9FVui4lzua/fwXqjKmjQ=
|
||||
github.com/siyuan-note/dejavu v0.0.0-20221009014342-57351eb27c75/go.mod h1:Y+bg0j0Z7C66oJWPPYMs+wZuFeiTRWhh2aLkqctJFKk=
|
||||
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75 h1:Bi7/7f29LW+Fm0cHc0J1NO1cZqyJwljSWVmfOqVZgaE=
|
||||
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75/go.mod h1:H8fyqqAbp9XreANjeSbc72zEdFfKTXYN34tc1TjZwtw=
|
||||
github.com/siyuan-note/eventbus v0.0.0-20220916025349-3ac6e75522da h1:/jNhl7LC+9BhkWvNxuJDdsNfA/2wvfuj9mqWx4CbV90=
|
||||
|
|
|
@ -682,15 +682,21 @@ func indexRepoBeforeCloudSync(repo *dejavu.Repo) (err error) {
|
|||
eventbus.CtxPushMsg: eventbus.CtxPushMsgToStatusBar,
|
||||
})
|
||||
if errors.Is(err, dejavu.ErrNotFoundObject) {
|
||||
logging.LogWarnf("data repo is corrupted, try to reset it")
|
||||
resetErr := os.RemoveAll(filepath.Join(repo.Path))
|
||||
if nil != resetErr {
|
||||
logging.LogErrorf("reset data repo failed: %s", resetErr)
|
||||
logging.LogErrorf("remove 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,
|
||||
})
|
||||
logging.LogWarnf("data repo has been reset")
|
||||
|
||||
go func() {
|
||||
time.Sleep(5 * time.Second)
|
||||
util.PushMsg(Conf.Language(105), 5000)
|
||||
}()
|
||||
}
|
||||
|
||||
if nil != err {
|
||||
|
|
Loading…
Add table
Reference in a new issue