Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "jqueue", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "MySQL backed plugable Node.js job queue based on the Beanstalk Job Lifecycle", | ||
@@ -5,0 +5,0 @@ "devDependencies": { |
@@ -55,3 +55,3 @@ var callBack = require('./callback'); | ||
this.release = function (parameter1, parameter2) { | ||
this.release = function (parameter1, parameter2, parameter3) { | ||
var cb; | ||
@@ -66,2 +66,7 @@ switch (arguments.length) { | ||
break; | ||
case 3: | ||
delay = parameter1; | ||
priority = parameter2; | ||
cb = parameter3; | ||
break; | ||
} | ||
@@ -125,5 +130,5 @@ var response = function (error, data) { | ||
function releaseMessage(cb) { | ||
execQuery('UPDATE ?? SET status = ?, date_time = DATE_ADD(CURRENT_TIMESTAMP, INTERVAL ? SECOND) \ | ||
WHERE id = ? AND version = ? AND status = ? AND time_to_run >= CURRENT_TIMESTAMP', | ||
[queueName, 'ready', delay, id, version, 'reserved'], cb); | ||
execQuery('UPDATE ?? SET status = ?, date_time = DATE_ADD(CURRENT_TIMESTAMP, INTERVAL ? SECOND), \ | ||
priority = ? WHERE id = ? AND version = ? AND status = ? AND time_to_run >= CURRENT_TIMESTAMP', | ||
[queueName, 'ready', delay, priority, id, version, 'reserved'], cb); | ||
} | ||
@@ -130,0 +135,0 @@ |
@@ -11,5 +11,5 @@ 'use strict'; | ||
var conncetionInfo = { | ||
host: '192.168.100.121', | ||
user: 'pdg', | ||
password: 'Senha!235', | ||
host: 'localhost', | ||
user: 'root', | ||
password: 'root', | ||
database: 'jqueue' | ||
@@ -16,0 +16,0 @@ }; |
@@ -5,5 +5,5 @@ var jqueue = require('../src/jqueue'); | ||
var conncetionInfo = { | ||
host: '192.168.100.121', | ||
user: 'pdg', | ||
password: 'Senha!235', | ||
host: 'localhost', | ||
user: 'root', | ||
password: 'root', | ||
database: 'jqueue' | ||
@@ -18,23 +18,20 @@ }; | ||
if (queue) { | ||
// queue.put('klalalallaa',0,0,'xupa2', function (error) { | ||
// console.log(error, queue); | ||
// queue.watch(5,5000,'xupa2',function (error, message) { | ||
// console.log(error, message); | ||
// if (!error && message) { | ||
// setTimeout(function () { | ||
// message.touch(function (error) { | ||
// console.log('touched', error); | ||
// }); | ||
// }, 3000); | ||
// setTimeout(function () { | ||
// message.bury(function (error) { | ||
// console.log('released', error); | ||
// }); | ||
// }, 6000); | ||
// } | ||
// }); | ||
// }); | ||
queue.pick(4, function (error, message) { | ||
console.log(error, message); | ||
}) | ||
queue.put('klalalallaa', function (error) { | ||
console.log(error, queue); | ||
queue.watch(function (error, message) { | ||
console.log(error, message); | ||
if (!error && message) { | ||
setTimeout(function () { | ||
message.touch(function (error) { | ||
console.log('touched', error); | ||
}); | ||
}, 3000); | ||
setTimeout(function () { | ||
message.release(function (error) { | ||
console.log('released', error); | ||
}); | ||
}, 6000); | ||
} | ||
}); | ||
}); | ||
} else { | ||
@@ -41,0 +38,0 @@ console.log(error); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1938
198639