Background Worker service exits after a while


I have a background worker service that uses Rails’ ActiveJob backed by Delayed Job. The Start Command is bundle exec rails jobs:work.

The service deploys and starts properly without errors. Yet, the rails jobs:work process exits about a minute later:

Feb 25 10:54:19 AM Your service is live :tada:
Feb 25 10:54:20 AM ==> Starting service with ‘bundle exec rails jobs:work’
Feb 25 10:55:20 AM [Worker(host:–redacted-- pid:69)] Starting job worker
Feb 25 10:55:20 AM I, [2023-02-23T10:22:28.607481 #69] INFO – : 2023-02-23T10:22:28+0000: [Worker(host:–redacted-- pid:69)] Starting job worker
Feb 25 10:55:20 AM [Worker(host:–redacted-- pid:69)] Exiting…
Feb 25 10:55:20 AM I, [2023-02-25T08:55:19.399714 #69] INFO – : 2023-02-25T08:55:19+0000: [Worker(host:–redacted-- pid:69)] Exiting…

Consulting the documentation and looking at the corresponding example makes me believe that the Start Command is correct.

In addition, the Delayed Job documentation mentions two ways to start a process:

  • bin/delayed_job start which requires the daemons gem
  • rails jobs:work, which I prefer as it does not require additional dependencies

Why does the Start Command exit? What am I missing?

Kind regards,

Issue is resolved.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.