Skip to content

Instantly share code, notes, and snippets.

@mattes
Created October 30, 2020 08:02
Show Gist options
  • Save mattes/8cf8c200483972aa5add2aa38fd8d3ed to your computer and use it in GitHub Desktop.
Save mattes/8cf8c200483972aa5add2aa38fd8d3ed to your computer and use it in GitHub Desktop.
Resque in distroless docker container
# config/initializers/resque.rb
module Resque
class Worker
# Monkey patch linux_worker_pids because the original function tries to shell out.
# Since we run distroless in production, there is no shell.
# https://github.com/resque/resque/blob/7f6b88404dd18698f6f4023e18fdc1ae8318e5e5/lib/resque/worker.rb#L839
def linux_worker_pids
[Process.pid]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment