Exemple #1
0
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'
    ])
Exemple #2
0
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'])
Exemple #3
0
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
Exemple #4
0
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