Hi,
the parameters in your call `queue.push` are wrong.
repeatTimes, repeatUntil, repeatDelay, success and failure have to be in
the same object as third param.
let jobId = queue.push(
{mount: '/test', name: 'sync'},
{},
{
repeatTimes: Infinity,
repeatUntil: Date.now() + (24 * 60 * 60 * 1000),
repeatDelay: 30 * 1000,
success: function () {
console.warn('Yay!');
},
failure: function () {
console.warn('Boo!');
}
}
)
Am Freitag, 9. Juni 2017 19:13:49 UTC+2 schrieb Adam:
>
> I currently have a foxx app which is mounted at the endpoint /test. A job
> is pushed to the queue in setup.js.
>
> //setup.js ===================================================
> const queues = require('@arangodb/foxx/queues');
> const queue = queues.create("queue-test");
>
> let jobId = queue.push(
> {mount: '/test', name: 'sync'},
> {
> repeatTimes: Infinity,
> repeatUntil: Date.now() + (24 * 60 * 60 * 1000),
> repeatDelay: 30 * 1000
> },
> {success: function () {
> console.log('Yay!');
> }
> },
> {failure: function () {
> console.log('Boo!');
> }
> }
> )
>
> console.log("Starting", jobId);
>
> //sync.js ===================================================
> console.log("Called sync SCRIPT!");
>
>
> //manifest.js ================================================
> {
> "name": "test123",
> "version": "1.0.0",
> "description": "test",
> "author": "testy",
> "engines": {
> "arangodb": "^3.1.0"
> },
> "scripts": {
> "sync": "scripts/sync.js",
> "setup": "scripts/setup.js"
> },
> "lib": "."
> }
>
> Console Output
> LoglevelDateMessage
> Info 2017-06-09 17:09:38 Yay!
> Info 2017-06-09 17:09:38 Called sync SCRIPT TEST!
> Info 2017-06-09 17:09:37 Starting _jobs/148870166
>
> I'm expecting this console output to be repeated every 30 seconds, but I
> only see it once. What am I missing? Thanks!
>
--
You received this message because you are subscribed to the Google Groups
"ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.