Okay… so I could have sworn that I tried that before, but I guess not, because just
rake jobs:work does keep the container running…
The issue I’m having now is the logging. I can confirm that the delayed_jobs service is necessary to do certain work, such as send a registration confirmation (if I scale that container to zero, it won’t send the email), but the log stream from the container does not show this work being done, and I’d like to be able to capture output if I want to. I’ve followed this example I came across:
desc "switch rails logger to stdout"
task :verbose => [:environment] do
Rails.logger = Logger.new(STDOUT)
desc "switch rails logger log level to debug"
task :debug => [:environment, :verbose] do
Rails.logger.level = Logger::DEBUG
and then changing the service definition to
rake verbose jobs:work but no dice. I’ve also added
Delayed::Worker.logger = Logger.new(STDOUT)
production.rb file but again, it didn’t help.
(Oddly, though, I am able to see messages from STDERR in the logs, but no STDOUT.)
Probably something easy, but since I’m not a developer, it’s all Greek to me.