acidiney / bull-queue

AdonisJS package to work with bull queues
MIT License
3 stars 2 forks source link

Prevent Redis Connection during Migrations, Seeding & Tests #2

Closed D40298008 closed 5 months ago

D40298008 commented 5 months ago

Hello!

How can I prevent this library from trying to connect to redis during the following scenarios where it isn't needed?

I tried disabling it in the provider (except for web) but then the node ace queue:listen fails.

// adonisrc.ts
providers: [
    () => import('@adonisjs/core/providers/app_provider'),
    //...
    {
        file        : () => import('@acidiney/bull-queue/queue_provider'),
        environment : ['web'],
    },
],
acidiney commented 5 months ago

Hey, yeah that is a difficult one, the Adonis doesn't provide a easy way to create environments, that's is why it fails.

All these operations are console environment operation, that's is why the package starts and if you ask it to only run it in web, it fails