RomainLanz / adonis-bull-queue

Queue system based on BullMQ for AdonisJS
MIT License
147 stars 26 forks source link

How to deploy on Heroku #21

Closed theRealPadster closed 7 months ago

theRealPadster commented 1 year ago

First of all, thanks for making this great queue wrapper. It was quite easy to set up and I'm very happy with it 👍 Now for my question: I have an Adonis web app running on Heroku and would like to run a queue in a worker dyno. I can run it locally and it works great, but when I deploy to Heroku, I get the following error: Error: AdonisJS requires "@adonisjs/assembler" in order to run typescript source directly

This is my Procfile:

web: node build/server.js
worker: node ace queue:listen

I noticed when I run the build command (node ace build --production), it doesn't make a new JS file for the queue/worker. Is there some way to make it generate something I can run on Heroku, like a build/queue.js?

theRealPadster commented 1 year ago

I got it to run with the following:

web: node build/server.js
worker: node build/ace queue:listen

But it looks like it runs the rest of the app lifecycle, since it runs the clear redis cache code that I have running on boot for the web app. Any idea how to get around this?

chimeyant commented 1 year ago

on pm2 just command pm2 start ace -- queue:listen