From cf64c054ab2e90589fbdd4ff9e4ac8e0619e84df Mon Sep 17 00:00:00 2001 From: Pedro Lopes <83576881+pedrompflopes@users.noreply.github.com> Date: Fri, 20 Oct 2023 12:02:46 +0100 Subject: [PATCH] add requested status to pooling pdf (#605) --- internal/commands/result.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/commands/result.go b/internal/commands/result.go index 0115faa60..68e53ee3e 100644 --- a/internal/commands/result.go +++ b/internal/commands/result.go @@ -56,6 +56,7 @@ const ( directDependencyType = "Direct Dependency" indirectDependencyType = "Transitive Dependency" startedStatus = "started" + requestedStatus = "requested" completedStatus = "completed" exportingStatus = "Exporting" pendingStatus = "Pending" @@ -1148,11 +1149,12 @@ func exportPdfResults(pdfWrapper wrappers.ResultsPdfWrapper, summary *wrappers.R log.Println("Generating PDF report") pollingResp.Status = startedStatus - for pollingResp.Status == startedStatus { + for pollingResp.Status == startedStatus || pollingResp.Status == requestedStatus { pollingResp, webErr, err = pdfWrapper.CheckPdfReportStatus(pdfReportID.ReportID) if err != nil || webErr != nil { return errors.Wrapf(err, "%v", webErr) } + logger.PrintfIfVerbose("PDF report status: %s", pollingResp.Status) time.Sleep(delayValueForReport * time.Millisecond) } if pollingResp.Status != completedStatus {