So I’ve got a plugin that kicks off Ansible to do a Discourse installation (I really, really, want to stop using WordPress to take installation orders!).
Initially, I was calling fork to kick it off, which worked fine in testing, but I thought that I should do it a more “Discourse Way”.
So then made a once-off job to run the process, but it gets killed like this:
I tried adding sidekiq_options queue: 'low' to the class, and then to the function that runs the job.
Then I skipped having the job run the process, and just ran it directly in the model with
Discourse::Utils.execute_command(*instructions)
It works just fine if I run it from rails c, but however I run it (this is a Ubuntu development environment, started with ./bin/unicorn, it gets killed.
Once-off jobs are jobs that will only execute, well, once. Looks like what you need is a regular job that will be scheduled by a trigger, like a request hitting a controller.
Regular jobs can be longer than 60s, as some do in normal usage.