Skip to content

Instantly share code, notes, and snippets.

View kamilbednarz's full-sized avatar

Kamil Bednarz kamilbednarz

View GitHub Profile
@kamilbednarz
kamilbednarz / stop_sidekiq.sh
Created February 14, 2018 12:18
Stop sidekiq, but first wait until it finishes all the running jobs
#!/bin/bash
RETRY_FREQUENCY=5
MAX_TRIES=100
PIDFILE=/var/www/app/current/tmp/pids/sidekiq.pid
# Helper function for printing logs with timestamp
echo_time() {
date +"[%H:%M:%S] [Sidekiq-smart-restart] $*"
}