mirror of https://gitee.com/bigwinds/arangodb
Style.
This commit is contained in:
parent
9b5acdf25a
commit
2572ce9664
|
@ -203,7 +203,6 @@ function Queue(name) {
|
||||||
|
|
||||||
_.extend(Queue.prototype, {
|
_.extend(Queue.prototype, {
|
||||||
push: function (name, data, opts) {
|
push: function (name, data, opts) {
|
||||||
var type, result, now;
|
|
||||||
if (typeof name !== 'string') {
|
if (typeof name !== 'string') {
|
||||||
throw new Error('Must pass a job type!');
|
throw new Error('Must pass a job type!');
|
||||||
}
|
}
|
||||||
|
@ -215,11 +214,11 @@ _.extend(Queue.prototype, {
|
||||||
if (!jobTypeCache[dbName]) {
|
if (!jobTypeCache[dbName]) {
|
||||||
jobTypeCache[dbName] = {};
|
jobTypeCache[dbName] = {};
|
||||||
}
|
}
|
||||||
type = jobTypeCache[dbName][name];
|
var type = jobTypeCache[dbName][name];
|
||||||
|
|
||||||
if (type !== undefined) {
|
if (type !== undefined) {
|
||||||
if (type.schema) {
|
if (type.schema) {
|
||||||
result = type.schema.validate(data);
|
var result = type.schema.validate(data);
|
||||||
if (result.error) {
|
if (result.error) {
|
||||||
throw result.error;
|
throw result.error;
|
||||||
}
|
}
|
||||||
|
@ -234,7 +233,7 @@ _.extend(Queue.prototype, {
|
||||||
throw new Error('Unknown job type: ' + name);
|
throw new Error('Unknown job type: ' + name);
|
||||||
}
|
}
|
||||||
resetQueueControl();
|
resetQueueControl();
|
||||||
now = Date.now();
|
var now = Date.now();
|
||||||
return db._jobs.save({
|
return db._jobs.save({
|
||||||
status: 'pending',
|
status: 'pending',
|
||||||
queue: this.name,
|
queue: this.name,
|
||||||
|
|
Loading…
Reference in New Issue