How to enable a worker dyno for a Heroku review app

113 Views Asked by At

I have a Rails v6.x app running on Heroku. We use review apps to preview features etc before they go live. Our app uses Sidekiq to manage background jobs that run on a worker dyno in production. When we open a pull request and the review app gets created, the worker dyno is automatically turned off. So none of the background tasks run unless we go in and manually turn it on. Is there a way to do this programmatically?

1

There are 1 best solutions below

0
On

Found it! This can be configured in app.json according to these docs: https://devcenter.heroku.com/articles/app-json-schema#formation

Ex for posterity:

{
  "formation": {
    "web": {
      "quantity": 1,
      "size": "standard-1x"
    },
    "worker": {
      "quantity": 1,
      "size": "standard-1x"
    }
  }
}