Mobrovac has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/394616 )
Change subject: Update documentation ...................................................................... Update documentation Change-Id: If5ac4dc0041db2c70d76aa5830ad50efc15be7cf --- M config.dev.yaml M lib/queue.js M lib/renderer.js 3 files changed, 17 insertions(+), 7 deletions(-) Approvals: Mobrovac: Verified; Looks good to me, approved diff --git a/config.dev.yaml b/config.dev.yaml index fb0bb35..23207c2 100644 --- a/config.dev.yaml +++ b/config.dev.yaml @@ -75,7 +75,7 @@ query: '{{ default(request.query, {}) }}' headers: '{{request.headers}}' body: '{{request.body}}' - # https://github.com/GoogleChrome/puppeteer/blob/v0.11.0/docs/api.md#pagepdfoptions + # https://github.com/GoogleChrome/puppeteer/blob/v0.13.0/docs/api.md#pagepdfoptions # Explicitly override defaults so that we don't have unexected results # after puppeteer upgrades pdf_options: @@ -91,7 +91,7 @@ # some room for page numbers bottom: '0.75in' left: '0.5in' - # https://github.com/GoogleChrome/puppeteer/blob/v0.11.0/docs/api.md#puppeteerlaunchoptions + # https://github.com/GoogleChrome/puppeteer/blob/v0.13.0/docs/api.md#puppeteerlaunchoptions puppeteer_options: timeout: 30000 args: diff --git a/lib/queue.js b/lib/queue.js index be5d42c..c7fa3f5 100644 --- a/lib/queue.js +++ b/lib/queue.js @@ -50,15 +50,16 @@ } /** - * Return number of waiting/in progress jobs + * Returns the number of waiting and in progress jobs * @return {number} */ _countJobsInQueue() { const queue = this._queueObject; return queue.length() + queue.running(); } + /** - * Whether the queue full + * Whether the queue is full * @return {boolean} whether the number of running and waiting tasks * is equal to a predefined maximum task count */ @@ -234,7 +235,7 @@ } /** - * Abort task identified by `id` + * Abort task identified by data * @param {Object} data initially pushed to the queue */ abort(data) { diff --git a/lib/renderer.js b/lib/renderer.js index dedc90f..1809e78 100644 --- a/lib/renderer.js +++ b/lib/renderer.js @@ -2,6 +2,11 @@ const puppeteer = require('puppeteer'); +/** + * PDF renderer from a URL. + * In order to keep debugging simple and performance predictable each + * request should create a new instance of the class. + */ module.exports = class Renderer { constructor() { this._browser = null; @@ -21,8 +26,12 @@ /** * Renders content from `url` in PDF * @param {string} url URL to get content from - * @param {Object} puppeteerOptions - * @param {Object} pdfOptions + * @param {Object} puppeteerOptions as defined by the puppeteer + * documentation. See + * https://github.com/GoogleChrome/puppeteer/blob/v0.13.0/docs/api.md#puppeteerlaunchoptions + * @param {Object} pdfOptions as defined by the puppeteer + * documentation. See + * https://github.com/GoogleChrome/puppeteer/blob/v0.13.0/docs/api.md#pagepdfoptions * @return {<Promise<Buffer>>} Promise which resolves with PDF buffer */ articleToPdf(url, puppeteerOptions, pdfOptions) { -- To view, visit https://gerrit.wikimedia.org/r/394616 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If5ac4dc0041db2c70d76aa5830ad50efc15be7cf Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/chromium-render Gerrit-Branch: master Gerrit-Owner: Bmansurov <bmansu...@wikimedia.org> Gerrit-Reviewer: Jdlrobson <jrob...@wikimedia.org> Gerrit-Reviewer: Mobrovac <mobro...@wikimedia.org> Gerrit-Reviewer: Pmiazga <pmia...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits