diff --git a/CHANGES.md b/CHANGES.md index 25acd5b..6cbd02b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,7 @@ history JSON files - Allow date time string for `--timestamp` parameter - Fixed completed progress bar showing empty +- Fixed crash in case of importer returning an error on import start ## 0.3.1 - 2023-12-10 diff --git a/internal/backends/export.go b/internal/backends/export.go index 9bdb8a1..44b8757 100644 --- a/internal/backends/export.go +++ b/internal/backends/export.go @@ -36,6 +36,7 @@ func (p ListensExportProcessor) ExportBackend() models.Backend { func (p ListensExportProcessor) Process(oldestTimestamp time.Time, results chan models.ListensResult, progress chan models.Progress) { p.Backend.ExportListens(oldestTimestamp, results, progress) + close(progress) } type LovesExportProcessor struct { @@ -48,4 +49,5 @@ func (p LovesExportProcessor) ExportBackend() models.Backend { func (p LovesExportProcessor) Process(oldestTimestamp time.Time, results chan models.LovesResult, progress chan models.Progress) { p.Backend.ExportLoves(oldestTimestamp, results, progress) + close(progress) } diff --git a/internal/cli/transfer.go b/internal/cli/transfer.go index e335f1b..427af06 100644 --- a/internal/cli/transfer.go +++ b/internal/cli/transfer.go @@ -126,7 +126,6 @@ func (c *TransferCmd[E, I, R]) Transfer(exp backends.ExportProcessor[R], imp bac if result.LastTimestamp.Unix() < timestamp.Unix() { result.LastTimestamp = timestamp } - close(exportProgress) wg.Wait() progress.Wait() if result.Error != nil {