Skip to content

Instantly share code, notes, and snippets.

@dizzyd
Created December 8, 2012 03:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dizzyd/4238503 to your computer and use it in GitHub Desktop.
Save dizzyd/4238503 to your computer and use it in GitHub Desktop.
@task
def check_worker():
# Check the status URL on the loopback
r = run("wget --timeout=5 -t 1 -O- http://localhost:8041 2>&1 >/dev/null", warn_only=True, quiet=True)
if r.return_code != 0:
# Something went wrong; kill all hallwayd.js and attempt to start it
sudo("pkill -9 node", warn_only=True)
sudo("start hallway-worker", warn_only=True)
sudo("start statsd", warn_only=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment