diff options
| -rw-r--r-- | python/Dawn/views.py | 8 | ||||
| -rw-r--r-- | python/client.py | 12 | ||||
| -rw-r--r-- | python/process_queue.py | 6 | ||||
| -rw-r--r-- | python/task_runner.py | 6 | ||||
| -rw-r--r-- | python/task_server/rest.py | 2 |
5 files changed, 18 insertions, 16 deletions
diff --git a/python/Dawn/views.py b/python/Dawn/views.py index daed2bba..f2336e33 100644 --- a/python/Dawn/views.py +++ b/python/Dawn/views.py @@ -28,10 +28,10 @@ def get_queue(): q = getattr(g, 'queue', None) if q is None: hostname = socket.gethostname() - if hostname == 'debian': - q = g.queue = redis.Redis(unix_socket_path='/var/run/redis/redis.sock') - elif hostname =='gomez': - q = g.queue = redis.Redis(host='debian') + if hostname == 'ziggy': + q = g.queue = redis.Redis(unix_socket_path='/run/redis/redis.sock') + elif hostname == 'debian': + q = g.queue = redis.Redis(host='ziggy') return q def get_db(): diff --git a/python/client.py b/python/client.py index 21eba000..b89a717a 100644 --- a/python/client.py +++ b/python/client.py @@ -10,12 +10,14 @@ from db import dbconn def run(): hostname = socket.gethostname() ET = dbconn('etdb') - if hostname == 'debian': - q = redis.Redis(unix_socket_path='/var/run/redis/redis.sock') - os.environ['OMP_NUM_THREADS'] = '8' - elif hostname == 'gomez': - q = redis.Redis(host='debian') + if hostname in ['debian', 'gomez']: + q = redis.Redis(host='ziggy') os.environ['OMP_NUM_THREADS'] = '4' + if hostname == 'debian': + os.envirion['OMP_NUM_THREADS'] = '8' + elif hostname == 'ziggy': + q = redis.Redis(unix_socket_path='/run/redis/redis.sock') + os.environ['OMP_NUM_THREADS'] = '8' while True: f, args = loads(q.blpop("tasks")[1].decode('utf-8')) if f == 'generate_scenarios': diff --git a/python/process_queue.py b/python/process_queue.py index b3e04029..37fe0d99 100644 --- a/python/process_queue.py +++ b/python/process_queue.py @@ -83,10 +83,10 @@ def decode_dict(d): def get_redis_queue(): hostname = socket.gethostname() - if hostname == 'debian': - return redis.Redis(unix_socket_path='/var/run/redis/redis.sock') + if hostname == 'ziggy': + return redis.Redis(unix_socket_path='/run/redis/redis.sock') else: - return redis.Redis(host = 'debian') + return redis.Redis(host='ziggy') def get_effective_date(d): return previous_twentieth(d + datetime.timedelta(days=1)) diff --git a/python/task_runner.py b/python/task_runner.py index bbb6a2e9..1e5738b7 100644 --- a/python/task_runner.py +++ b/python/task_runner.py @@ -12,11 +12,11 @@ from termcolor import colored def run(): hostname = socket.gethostname() ET = dbconn('etdb') - if hostname == 'debian': - q = redis.Redis(unix_socket_path='/var/run/redis/redis.sock') + if hostname == 'ziggy': + q = redis.Redis(unix_socket_path='/run/redis/redis.sock') os.environ['OMP_NUM_THREADS'] = '8' else: - q = redis.Redis(host='debian') + q = redis.Redis(host='ziggy') os.environ['OMP_NUM_THREADS'] = '4' notify("READY=1") while True: diff --git a/python/task_server/rest.py b/python/task_server/rest.py index 6aa103bb..a8567250 100644 --- a/python/task_server/rest.py +++ b/python/task_server/rest.py @@ -20,7 +20,7 @@ def get_db(): def get_queue(): q = getattr(g, 'queue', None) if q is None: - q = g.queue = redis.Redis(unix_socket_path='/var/run/redis/redis.sock') + q = g.queue = redis.Redis(unix_socket_path='/run/redis/redis.sock') return q @app.teardown_appcontext |
