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
+2 -2
View File
@@ -6,7 +6,7 @@ import "time"
// unavailable or the user's WebDAV permission was not yet configured.
func (a *App) resyncPendingUploads() {
var tasks []Task
if err := a.db.Where("status = ? AND local_path <> ? AND (remote_path = ? OR remote_path IS NULL)", "done", "", "").Order("id asc").Limit(100).Find(&tasks).Error; err != nil {
if err := a.db.Where("status IN ? AND local_path <> ? AND (remote_path = ? OR remote_path IS NULL)", []string{"done", "upload_pending", "error"}, "", "").Order("id asc").Limit(100).Find(&tasks).Error; err != nil {
return
}
for i := range tasks {
@@ -20,7 +20,7 @@ func (a *App) resyncPendingUploads() {
}
// startWebDAVResync runs a small periodic repair loop. It is intentionally
// conservative: only completed local tasks without a remote path are retried.
// conservative: only tasks with a completed local file and no confirmed remote path are retried.
func (a *App) startWebDAVResync() {
go func() {
a.resyncPendingUploads()