Skip to content

Commit

Permalink
Remove TODO comment about viewMsgRecipeDownloadResultMsg
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrunwald committed Sep 16, 2024
1 parent ccffa91 commit ab5f672
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cmd/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,15 +429,22 @@ func runSyncCommandLogic(p *tea.Program, logger *slog.Logger, config *syncComman
p.Send(newRecipeRunDataRecordMsg{record: runDataSupplierRecord})
recipeRunData = append(recipeRunData, runDataSupplierRecord)

// TODO Do we need viewMsgRecipeDownloadResultMsg ? We send the same data in newRecipeRunDataRecordMsg
// We send the recipeResult in a separate message to the view layer
// This could be optimized (and bundled together with newRecipeRunDataRecordMsg),
// but for now this is good enough.
p.Send(viewMsgRecipeDownloadResultMsg{
duration: time.Since(startTime),
newFilesCount: recipeResult.NewFilesCount,
step: recipeResult.StatusTextFormatted,
errorMessage: recipeResult.LastErrorMessage,
})

logger.Info("Downloading invoices ... completed", "supplier", recipesToExecute[i].recipe.Supplier, "supplier_type", recipesToExecute[i].recipe.Type, "duration", time.Since(startTime), "new_files", recipeResult.NewFilesCount)
logger.Info("Downloading invoices ... completed",
"supplier", recipesToExecute[i].recipe.Supplier,
"supplier_type", recipesToExecute[i].recipe.Type,
"duration", time.Since(startTime),
"new_files", recipeResult.NewFilesCount,
)
invoiceLabel := "invoices"
if recipeResult.NewFilesCount == 1 {
invoiceLabel = "invoice"
Expand Down

0 comments on commit ab5f672

Please sign in to comment.