Skip to content

Commit

Permalink
Shutdown worker droid when zk conn is lost
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalg0wda committed Jun 15, 2017
1 parent 5ba4151 commit a34f948
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hedroid/worker/zk_droid.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import sys

from kazoo.client import KazooClient, KazooState
from kazoo.recipe.watchers import DataWatch
Expand Down Expand Up @@ -26,6 +27,7 @@ def conn_listener(state):
logger.debug('connected...')
elif state == KazooState.LOST:
logger.debug('connection lost...')
sys.exit()
elif state == KazooState.SUSPENDED:
logger.debug('connection suspended...')

Expand Down

0 comments on commit a34f948

Please sign in to comment.