Commit f8f1841c authored by Christopher Schinnerl's avatar Christopher Schinnerl

don't add stream downloads to history

parent 23b877e8
Pipeline #46384790 passed with stages
in 30 minutes and 30 seconds
......@@ -342,10 +342,12 @@ func (r *Renter) managedDownload(p modules.RenterDownloadParameters) (*download,
return nil, err
}
// Add the download object to the download queue.
r.downloadHistoryMu.Lock()
r.downloadHistory = append(r.downloadHistory, d)
r.downloadHistoryMu.Unlock()
// Add the download object to the download history if it's not a stream.
if destinationType != destinationTypeSeekStream {
r.downloadHistoryMu.Lock()
r.downloadHistory = append(r.downloadHistory, d)
r.downloadHistoryMu.Unlock()
}
// Return the download object
return d, nil
......
......@@ -736,6 +736,17 @@ func testStreamingCache(t *testing.T, tg *siatest.TestGroup) {
t.Fatal("download took longer than 30 seconds")
}
}
// Make sure that the stream downloads don't show up in the download
// history.
rgg, err := r.RenterDownloadsGet()
if err != nil {
t.Fatal(err)
}
for _, download := range rgg.Downloads {
if download.DestinationType == "httpseekstream" {
t.Fatal("Stream downloads shouldn't be added to the history")
}
}
}
// testUploadDownload is a subtest that uses an existing TestGroup to test if
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment