Skip to content

Instantly share code, notes, and snippets.

@jklimke
jklimke / start_delayed_job_blocking.sh
Created July 17, 2020 13:12
script for executing rails delayed jobs in a blocking manner, e.g., for running in an docker container
#!/bin/bash
# Variable DELAYED_JOB_ARGS contains the arguments for delayed jobs for, e.g. defining queues and worker pools.
# function that is called when the docker container should stop. It stops the delayed job processes
_term() {
echo "Caught SIGTERM signal! Stopping delayed jobs !"
# unbind traps
trap - SIGTERM
trap - TERM