Skip to content

Instantly share code, notes, and snippets.

@kljensen
Created October 7, 2013 17:44
Show Gist options
  • Select an option

  • Save kljensen/6871946 to your computer and use it in GitHub Desktop.

Select an option

Save kljensen/6871946 to your computer and use it in GitHub Desktop.
How I get verbal notification of code reloads while developing locally... see the "watchmedo....say" part.
web: env REDIS_MAX_CONNECTIONS=27 gunicorn --pid /tmp/ss-gunicorn.pid -k gevent 'manage:create_and_config_app()'
redis: redis-server bin/config/redis.conf
watchdog:watchmedo shell-command --patterns="*.py;*.yaml" --recursive --command='kill -HUP $(cat /tmp/ss-gunicorn.pid) && say "code reloaded, dude."'
@kljensen

kljensen commented Oct 7, 2013

Copy link
Copy Markdown
Author

Notice how watchdog watches files, kills the PID, and calls the say command. Foreman/honcho automatically restarts the processed killed at the PID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment