Skip to content

Commit

Permalink
Merge pull request #532 from bcgov/ccof-puppeteer-debug
Browse files Browse the repository at this point in the history
Fix race condition and update docker image to current LTS
  • Loading branch information
trev-dev authored Oct 10, 2024
2 parents dc44cfb + 12265fe commit 091ba91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM artifacts.developer.gov.bc.ca/docker-remote/node:16.20.0-alpine3.18
FROM artifacts.developer.gov.bc.ca/docker-remote/node:20.18.0-alpine3.20

ENV NPM_CONFIG_CACHE /tmp/npm
RUN mkdir -p /logs \
Expand Down
6 changes: 3 additions & 3 deletions backend/src/components/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -504,11 +504,13 @@ async function printPdf(req, numOfRetries = 0) {

await postChangeRequestSummaryDocument(payload);
}

browser.close();
return payload;
} catch (e) {
log.error(e);

if (browser.process() !== null) { await browser.close(); }

if (numOfRetries >= 3) {
log.info('printPdf :: maximum number of retries reached');
log.error(`printPdf :: unable to save pdf for application id ${req.params.applicationId}`);
Expand All @@ -519,8 +521,6 @@ async function printPdf(req, numOfRetries = 0) {
log.info(`printPdf :: retry count ${retryCount}`);
await printPdf(req, retryCount);
}
} finally {
await browser.close();
}
}

Expand Down

0 comments on commit 091ba91

Please sign in to comment.