squiss-jobs
Advanced tools
Comparing version 1.0.1 to 1.0.2
15
index.js
@@ -7,3 +7,3 @@ const Consumer = require('sqs-consumer') | ||
always, bind, compose, curryN, dissoc, identity, merge, | ||
mergeAll, nAry, partial | ||
mergeAll, nAry, once, partial, tap | ||
} = require('ramda') | ||
@@ -46,8 +46,11 @@ | ||
const processJob = ({ type, payload }, done) => { | ||
const details = mergeAll([ options, { type, payload }, timeoutErr ]), | ||
logTimeout = partial(timeoutLogger, [ details ]), | ||
timeout = setTimeout(logTimeout, visibilityTimeout * 1000), | ||
finish = compose(partial(clearTimeout, [ timeout ]), done) | ||
const processJob = ({ type, payload }, callback) => { | ||
const done = once(callback) | ||
details = mergeAll([ options, { type, payload }, timeoutErr ]), | ||
logTimeout = partial(timeoutLogger, [ details ]), | ||
handleTimeout = compose(partial(done, [ new Error(timeoutErr.error) ]), tap(logTimeout)) | ||
timeout = setTimeout(handleTimeout, visibilityTimeout * 1000), | ||
finish = compose(tap(partial(clearTimeout, [ timeout ])), done) | ||
return Promise.resolve(payload) | ||
@@ -54,0 +57,0 @@ .then(handlerFor(type)) |
{ | ||
"name": "squiss-jobs", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "SQS-backed job queue", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
6056
58
1