mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-19 14:53:44 +00:00
test(download): cover deletion during preparation and late callbacks
This commit is contained in:
1 parent
917fc64046
commit
54fc0f7289
2 files changed
+123
-6
No files matched your search
@@ -1550,12 +1550,7 @@ func (d *Downloader) doDelete(task *Task, force bool) (err error) {
|
||||
defer task.lifetime.mu.Unlock()
|
||||
defer func() {
|
||||
if err != nil {
|
||||
// Keep failed deletions recoverable, but never revive the invalidated run.
|
||||
task.statusLock.Lock()
|
||||
if task.Status == base.DownloadStatusRunning {
|
||||
task.updateStatus(base.DownloadStatusPause)
|
||||
}
|
||||
task.statusLock.Unlock()
|
||||
// Keep failed deletions recoverable without validating the old run.
|
||||
task.lifetime.deleted.Store(false)
|
||||
}
|
||||
}()
|
||||
|
||||
Reference in new issue
Block a user