ruby-on-railsrubybackgroundrb

Backgroundrb scheduled task ending


I have a backroundrb scheduled task that takes quite a long time to run. However it seems that the process is ending after only 2.5 minutes.

My background.yml file:

:schedules:
  :named_worker:
    :task_name:
      :trigger_args: 0 0 12 * * * *
      :data: input_data

I have zero activity on the server when the process is running. (Meaning I am the only one on the server watching the log files do their thing until the process suddenly stops.)

Any ideas?


Solution

  • There's not much information here that allows us to get to the bottom of the problem. Because backgroundrb operates in the background, it can be quite hard to monitor/debug.

    Here are some ideas I use:

    1. Write a unit test to test the worker code itself and make sure there are no problems there
    2. Put "puts" statements at multiple points in the code so you can at least see some responses while the worker is running.
    3. Wrap the entire worker in a begin..rescue..end block so that you can catch any errors that might be occurring and cutting the process short.