Ejemplo n.º 1
0
def configured_app(request, app_config):
    from datacat.core import make_app

    app_config.update(_celery_testing_conf())

    app = make_app(app_config)
    app.debug = True

    return app
Ejemplo n.º 2
0
             Don't use this in production!
"""

REDIS_PORT = 6389
WEBSERVER_PORT = 8080


import multiprocessing
import tempfile
import time
import subprocess

from datacat.core import make_app, celery_app


app = make_app()


def run_webapp():
    app.run(host='127.0.0.1', port=WEBSERVER_PORT)


def run_celery():
    redis_url = 'redis://127.0.0.1:{0}/0'.format(REDIS_PORT)
    celery_app.conf.BROKER_URL = redis_url
    celery_app.conf.RESULT_BACKEND = redis_url
    celery_app.worker_main(argv=['datacat.launcher'])


def run_redis():
    tempdir = tempfile.mkdtemp()