Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an example index.json file #209

Open
olliechick opened this issue Jun 25, 2021 · 4 comments
Open

Provide an example index.json file #209

olliechick opened this issue Jun 25, 2021 · 4 comments

Comments

@olliechick
Copy link

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)
    ...
@bitops
Copy link

bitops commented Sep 1, 2021

@olliechick the options are documented here: https://github.com/bee-queue/arena/#usage

@olliechick
Copy link
Author

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?

@bitops
Copy link

bitops commented Sep 1, 2021

@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"
      }
    }
  ]
}

@spiffytech
Copy link

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.

spiffytech added a commit to spiffytech/docker-arena that referenced this issue Dec 7, 2021
Per bee-queue#209, the `bullmq` package doesn't return a single constructor, so docker-arena needs to instantiate the `Queue` class specifically.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants