def handle_term(signum, frame): print "SIGTERM caught in main process" global die die = True from uuss import stats stats.stop() sys.exit()
def handle_term(signum, frame): log.warn("SIGTERM caught in worker process") global die die = True shutdown_event.set() restart_or_die_event.set() from uuss import stats stats.stop() global server if server: stop() server = None