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
|
@ -97,8 +97,6 @@ func (b *JSPFBackend) FinishImport() error {
|
|||
}
|
||||
|
||||
func (b *JSPFBackend) ExportListens(oldestTimestamp time.Time, results chan models.ListensResult, progress chan models.Progress) {
|
||||
defer close(results)
|
||||
|
||||
err := b.readJSPF()
|
||||
if err != nil {
|
||||
progress <- models.Progress{}.Complete()
|
||||
|
@ -131,8 +129,6 @@ func (b *JSPFBackend) ImportListens(export models.ListensResult, importResult mo
|
|||
}
|
||||
|
||||
func (b *JSPFBackend) ExportLoves(oldestTimestamp time.Time, results chan models.LovesResult, progress chan models.Progress) {
|
||||
defer close(results)
|
||||
|
||||
err := b.readJSPF()
|
||||
if err != nil {
|
||||
progress <- models.Progress{}.Complete()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue