UpdateProgress updates progress for an operation. The cancellable flag is persisted on every tick so a replica that restarts mid-install rehydrates the op as still cancellable — otherwise the column keeps its Create-time zero value (false), the UI hides the cancel button, and the orphaned op can onl
(id string, progress float64, message, downloadedSize string, cancellable bool)
| 85 | // value (false), the UI hides the cancel button, and the orphaned op can only |
| 86 | // be dismissed by waiting for the 30-minute stale reaper. |
| 87 | func (s *GalleryStore) UpdateProgress(id string, progress float64, message, downloadedSize string, cancellable bool) error { |
| 88 | return s.db.Model(&GalleryOperationRecord{}).Where("id = ?", id).Updates(map[string]any{ |
| 89 | "progress": progress, |
| 90 | "message": message, |
| 91 | "downloaded_file_size": downloadedSize, |
| 92 | "cancellable": cancellable, |
| 93 | "updated_at": time.Now(), |
| 94 | }).Error |
| 95 | } |
| 96 | |
| 97 | // UpdateStatus updates the status of an operation. A terminal status is never |
| 98 | // cancellable, so the flag is cleared here to keep the persisted row consistent |
no outgoing calls
no test coverage detected