Skip to content

Commit

Permalink
add requested status to pooling pdf (#605)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrompflopes authored Oct 20, 2023
1 parent 1bcc5b2 commit cf64c05
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/commands/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const (
directDependencyType = "Direct Dependency"
indirectDependencyType = "Transitive Dependency"
startedStatus = "started"
requestedStatus = "requested"
completedStatus = "completed"
exportingStatus = "Exporting"
pendingStatus = "Pending"
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit cf64c05

Please sign in to comment.