Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
currentToken().then((token) => {
librato.timing('iso.render_time', (libratoDone) => {
// Kick off the render
console.log(`[${requestId}][render] Enqueueing render`)
const renderOpts = {
accessToken: token.token.access_token,
expiresAt: token.token.expires_at,
originalUrl: req.originalUrl,
url: req.url,
timingHeader,
requestId,
}
const job = queue
.create('render', renderOpts)
.ttl(1.1 * preRenderTimeout) // So we don't lose the job mid-timeout
.removeOnComplete(true)
.save()