diff --git a/manage.py b/manage.py index 64bea622..24d35c11 100644 --- a/manage.py +++ b/manage.py @@ -1,7 +1,5 @@ """ -CLI to start the workers. - -TODO: move API server startup here. +CLI to manage redash. """ import atfork atfork.monkeypatch_os_fork_functions() @@ -10,11 +8,8 @@ atfork.stdlib_fixer.fix_logging_module() import argparse import logging -import urlparse -import redis import time -import settings -import data +from redash import settings, data, redis_connection, data_manager def start_workers(data_manager): @@ -48,10 +43,6 @@ if __name__ == '__main__': parser.add_argument("command") args = parser.parse_args() - url = urlparse.urlparse(settings.REDIS_URL) - redis_connection = redis.StrictRedis(host=url.hostname, port=url.port, db=0, password=url.password) - data_manager = data.Manager(redis_connection, settings.INTERNAL_DB_CONNECTION_STRING, settings.MAX_CONNECTIONS) - if args.command == "worker": start_workers(data_manager) else: diff --git a/redash/api.py b/redash/api.py index a9f77ce9..a4653bfe 100644 --- a/redash/api.py +++ b/redash/api.py @@ -25,9 +25,9 @@ from flask import g, render_template, send_from_directory, make_response, reques from flask.ext.restful import Resource, abort import sqlparse -import settings -from data import utils -import data +from redash import settings +from redash.data import utils +from redash import data from redash import app, auth, api, redis_connection, data_manager