def run_gunicorn(): subprocess.check_call([ 'gunicorn', '--debug', '-b', Config.get('server', 'bind'), '-w', Config.get('server', 'workers'), '-t', Config.get('server', 'timeout'), '-p', Config.get('server', 'pid_file'), '-k', 'gevent', 'adama:app' ])
def run_gunicorn(): subprocess.check_call( ['gunicorn', '--debug', '-b', Config.get('server', 'bind'), '-w', Config.get('server', 'workers'), '-t', Config.get('server', 'timeout'), '-p', Config.get('server', 'pid_file'), '-k', 'gevent', 'adama:app'])
def check_queue(display=False): """Check that we can establish a connection to the queue.""" from adama.config import Config host = Config.get('queue', 'host') port = Config.getint('queue', 'port') try: q = QueueConnection(queue_host=host, queue_port=port, queue_name='test') q.delete() return True except Exception: if display: print(dedent( """ Cannot connect to queue exchange at {0}:{1} with dummy queue "test". Please, check ~/.adama.conf """.format(host, port)), file=sys.stderr) return False
def check_queue(display=False): """Check that we can establish a connection to the queue.""" from adama.config import Config host = Config.get('queue', 'host') port = Config.getint('queue', 'port') try: q = QueueConnection(queue_host=host, queue_port=port, queue_name='test') q.delete() return True except Exception: if display: print(dedent(""" Cannot connect to queue exchange at {0}:{1} with dummy queue "test". Please, check ~/.adama.conf """.format(host, port)), file=sys.stderr) return False