mirror of
https://git.sr.ht/~phw/scotty
synced 2025-05-10 10:17:04 +02:00
Close export results channel in generic implementation
This removes the need for every implementation to handle this case.
This commit is contained in:
parent
16245e495d
commit
5fb1596d61
11 changed files with 5 additions and 32 deletions
|
@ -93,8 +93,6 @@ func (b *LastfmApiBackend) ExportListens(oldestTimestamp time.Time, results chan
|
|||
minTime := oldestTimestamp
|
||||
perPage := MaxItemsPerGet
|
||||
|
||||
defer close(results)
|
||||
|
||||
// We need to gather the full list of listens in order to sort them
|
||||
p := models.Progress{Total: int64(page)}
|
||||
|
||||
|
@ -258,8 +256,6 @@ func (b *LastfmApiBackend) ExportLoves(oldestTimestamp time.Time, results chan m
|
|||
page := 1
|
||||
perPage := MaxItemsPerGet
|
||||
|
||||
defer close(results)
|
||||
|
||||
loves := make(models.LovesList, 0, 2*MaxItemsPerGet)
|
||||
p := models.Progress{Total: int64(perPage)}
|
||||
var totalCount int
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue