mirror of https://gitee.com/bigwinds/arangodb
Moved queue creation to queue manager init
This commit is contained in:
parent
67e2264603
commit
ef50d88f5e
|
@ -336,8 +336,6 @@ _.extend(Queue.prototype, {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
createQueue('default');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
_updateQueueDelay: updateQueueDelay,
|
_updateQueueDelay: updateQueueDelay,
|
||||||
get: getQueue,
|
get: getQueue,
|
||||||
|
|
|
@ -136,7 +136,9 @@ exports.manage = function () {
|
||||||
} else {
|
} else {
|
||||||
runInDatabase();
|
runInDatabase();
|
||||||
}
|
}
|
||||||
} catch (e) {}
|
} catch (e) {
|
||||||
|
// noop
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// switch back into previous database
|
// switch back into previous database
|
||||||
|
@ -151,6 +153,9 @@ exports.run = function () {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var queues = require('org/arangodb/foxx/queues');
|
||||||
|
queues.create('default');
|
||||||
|
|
||||||
// wakeup/poll interval for Foxx queues
|
// wakeup/poll interval for Foxx queues
|
||||||
var period = 1;
|
var period = 1;
|
||||||
if (options.hasOwnProperty('server.foxx-queues-poll-interval')) {
|
if (options.hasOwnProperty('server.foxx-queues-poll-interval')) {
|
||||||
|
@ -164,12 +169,14 @@ exports.run = function () {
|
||||||
try {
|
try {
|
||||||
db._useDatabase(name);
|
db._useDatabase(name);
|
||||||
db._jobs.updateByExample({status: 'progress'}, {status: 'pending'});
|
db._jobs.updateByExample({status: 'progress'}, {status: 'pending'});
|
||||||
require('org/arangodb/foxx/queues')._updateQueueDelay();
|
queues._updateQueueDelay();
|
||||||
} catch(e) {}
|
} catch(e) {
|
||||||
|
// noop
|
||||||
|
}
|
||||||
});
|
});
|
||||||
db._useDatabase(initialDatabase);
|
db._useDatabase(initialDatabase);
|
||||||
|
|
||||||
return tasks.register({
|
tasks.register({
|
||||||
command: function () {
|
command: function () {
|
||||||
require('org/arangodb/foxx/queues/manager').manage();
|
require('org/arangodb/foxx/queues/manager').manage();
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue