Provide an example index.json file
olliechick opened this issue · 4 comments
There is no example index.json
file, so it is not clear what should go in it.
With my current index.json
, I get the error:
UnhandledPromiseRejectionWarning: TypeError: BullMQ is not a constructor
at Queues.get (/opt/arena/node_modules/bull-arena/src/server/queue/index.js:102:15)
...
@olliechick the options are documented here: https://github.com/bee-queue/arena/#usage
My index.json
looks like this:
{
"queues": [
{
"type": "bullmq",
"name": "REDACTED1",
"hostId": "REDACTED2",
"redis": {
"host": "REDACTED3",
"port": 6379,
"password": "REDACTED4"
}
}
],
"flows": [
{
"type": "bullmq",
"name": "REDACTED1",
"hostId": "REDACTED2",
"redis": {
"host": "REDACTED3",
"port": 6379,
"password": "REDACTED4"
}
}
]
}
It doesn't have the queueing library that is documented in the link you provided - how would I import that?
@olliechick did you try:
{
Bull,
"queues": [
{
"type": "bullmq",
"name": "REDACTED1",
"hostId": "REDACTED2",
"redis": {
"host": "REDACTED3",
"port": 6379,
"password": "REDACTED4"
}
}
],
"flows": [
{
"type": "bullmq",
"name": "REDACTED1",
"hostId": "REDACTED2",
"redis": {
"host": "REDACTED3",
"port": 6379,
"password": "REDACTED4"
}
}
]
}
I get the same error with BullMQ. The above example isn't valid JSON, it's JS (and produces a JSON parse error if I try using it anyway).
The problem is that docker-arena expects require('bullmq')
to return a constructor, but it instead returns a bunch of different classes. I modified that line in index.js
to read:
return BullMQ || (BullMQ = require('bullmq').Queue);
and I've got docker-arena working.