mirror of
https://git.sr.ht/~phw/scotty
synced 2025-06-05 04:58:33 +02:00
If dump does no write to file, output the result as log
This commit is contained in:
parent
312d9860cf
commit
4da5697435
10 changed files with 29 additions and 15 deletions
|
@ -107,7 +107,7 @@ func process[R models.LovesResult | models.ListensResult, P ImportProcessor[R]](
|
|||
|
||||
for exportResult := range results {
|
||||
if err := ctx.Err(); err != nil {
|
||||
processor.ImportBackend().FinishImport()
|
||||
processor.ImportBackend().FinishImport(&result)
|
||||
out <- handleError(result, err, progress)
|
||||
return
|
||||
}
|
||||
|
@ -116,14 +116,14 @@ func process[R models.LovesResult | models.ListensResult, P ImportProcessor[R]](
|
|||
ctx, exportResult, result.Copy(), out, progress)
|
||||
result.Update(&importResult)
|
||||
if err != nil {
|
||||
processor.ImportBackend().FinishImport()
|
||||
processor.ImportBackend().FinishImport(&result)
|
||||
out <- handleError(result, err, progress)
|
||||
return
|
||||
}
|
||||
progress <- p.FromImportResult(result, false)
|
||||
}
|
||||
|
||||
if err := processor.ImportBackend().FinishImport(); err != nil {
|
||||
if err := processor.ImportBackend().FinishImport(&result); err != nil {
|
||||
out <- handleError(result, err, progress)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue