The Code in get_pdf_download_url_for_confluence_cloud checks for errors in the PDF Export like this:
if percentage_complete == 100:
running_task = False
log.info("Task completed - {task_state}".format(task_state=task_state))
if task_state == "FAILED":
log.error("PDF conversion not successful.")
return None
log.debug("Extract task results to download PDF.")
task_result_url = progress_response.get("result")
else:
…
However, pages can fail at any percentage, leading to repeated checks (which never complete):
INFO:atlassian.confluence:50% - FAILED
INFO:atlassian.confluence:Check if export task has completed.
INFO:atlassian.confluence:50% - FAILED
INFO:atlassian.confluence:Check if export task has completed.
…
The Code should the Task-State at every poll-roundtrip and return an error whenever it is ERROR.
The Code in
get_pdf_download_url_for_confluence_cloud
checks for errors in the PDF Export like this:However, pages can fail at any percentage, leading to repeated checks (which never complete):
The Code should the Task-State at every poll-roundtrip and return an error whenever it is
ERROR
.