fix: make WebDAV upload retry reliable

This commit is contained in:
OpenClaw Agent
2026-09-17 06:41:35 +08:00
parent efb2ff33b4
commit 40d99e1e22
5 changed files with 59 additions and 7 deletions
+3 -3
View File
@@ -19,9 +19,8 @@ func (a *App) upload(t *Task) {
}
a.db.Model(t).Updates(map[string]any{"status": "uploading"})
remote := strings.TrimRight(root, "/") + "/" + safe(t.Artist) + "/" + safe(t.Album) + "/" + safe(t.Title) + "." + safe(t.Format)
t.RemotePath = remote
if err := storage.MkdirAll(filepath.ToSlash(filepath.Dir(remote))); err != nil {
a.fail(t, err)
a.failUpload(t, err)
return
}
if fi, err := os.Stat(t.LocalPath); err == nil {
@@ -37,9 +36,10 @@ func (a *App) upload(t *Task) {
}
}
if err := storage.Upload(t.LocalPath, remote); err != nil {
a.fail(t, err)
a.failUpload(t, err)
return
}
t.RemotePath = remote
if a.cfg.WebDAVVersionPolicy == "replace_lower" {
a.cleanupLowerQualityVersions(t, storage)
}