mirror of
https://github.com/valitydev/redash.git
synced 2024-11-06 09:05:17 +00:00
Fix: bring back support for MySQL
This commit is contained in:
parent
2942d20ac3
commit
250aa17e63
@ -20,7 +20,7 @@ def start_workers():
|
||||
|
||||
logging.info("Cleaning old workers: %s", old_workers)
|
||||
|
||||
data_manager.start_workers(settings.WORKERS_COUNT, settings.CONNECTION_STRING)
|
||||
data_manager.start_workers(settings.WORKERS_COUNT, settings.CONNECTION_ADAPTER, settings.CONNECTION_STRING)
|
||||
logging.info("Workers started.")
|
||||
|
||||
while True:
|
||||
|
@ -149,15 +149,15 @@ class Manager(object):
|
||||
|
||||
return data
|
||||
|
||||
def start_workers(self, workers_count, connection_string):
|
||||
def start_workers(self, workers_count, connection_type, connection_string):
|
||||
if self.workers:
|
||||
return self.workers
|
||||
|
||||
|
||||
if getattr(settings, 'CONNECTION_ADAPTER', None) == "mysql":
|
||||
import query_runner_mysql
|
||||
from redash.data import query_runner_mysql
|
||||
runner = query_runner_mysql.mysql(connection_string)
|
||||
else:
|
||||
import query_runner
|
||||
from redash.data import query_runner
|
||||
runner = query_runner.redshift(connection_string)
|
||||
|
||||
redis_connection_params = self.redis_connection.connection_pool.connection_kwargs
|
||||
|
@ -10,8 +10,7 @@ import logging
|
||||
import json
|
||||
import MySQLdb
|
||||
import sys
|
||||
import select
|
||||
from .utils import JSONEncoder
|
||||
from redash.utils import JSONEncoder
|
||||
|
||||
def mysql(connection_string):
|
||||
if connection_string.endswith(';'):
|
@ -4,7 +4,7 @@ Example settings module. You should make your own copy as settings.py and enter
|
||||
REDIS_URL = "redis://localhost:6379"
|
||||
|
||||
# Either "pg" or "mysql"
|
||||
CONNECTION_ADAPTER = "mysql"
|
||||
CONNECTION_ADAPTER = "pg"
|
||||
# Connection string for the database that is used to run queries against
|
||||
# -- example mysql CONNECTION_STRING = "Server=;User=;Pwd=;Database="
|
||||
# -- example pg CONNECTION_STRING = "user= password= host= port=5439 dbname="
|
||||
|
Loading…
Reference in New Issue
Block a user