I have cofigured a Rails app web service and a Solid Queue worker service sharing a single database service along the following lines:
databases:
- name: my-db
plan: free
services:
- type: web
name: my-api
runtime: ruby
plan: starter
buildCommand: ./bin/render-build.sh
startCommand: "bundle exec rails server"
healthCheckPath: /up
envVars:
- key: DATABASE_URL
fromDatabase:
name: my-db
property: connectionString
- key: WEB_CONCURRENCY
value: 2
- type: worker
name: my-queue
runtime: ruby
plan: starter
buildCommand: bundle install
startCommand: bundle exec rake solid_queue:start
envVars:
- key: DATABASE_URL
fromDatabase:
name: my-db
property: connectionString
However, although both the Rails app and the Solid Queue worker start up OK, the worker shuts down approximately 1 minute after a deployment:
==> Your service is live 🎉
==> Running 'bundle exec rake solid_queue:start'
[SolidQueue] Starting Dispatcher(pid=97, hostname=srv-co6st3en7f5s739c6t50-7fd94c8c74-xr7dw, metadata={:polling_interval=>1, :batch_size=>500, :concurrency_maintenance_interval=>600, :recurring_schedule=>nil})
[SolidQueue] Starting Worker(pid=100, hostname=srv-co6st3en7f5s739c6t50-7fd94c8c74-xr7dw, metadata={:polling_interval=>0.1, :queues=>"*", :thread_pool_size=>3})
[SolidQueue] Terminating gracefully...
Am I missing something…?
Someone reported a very similar problem here. Unfortunately they didn’t post the solution.