diff options
Diffstat (limited to 'python/client.py')
| -rw-r--r-- | python/client.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/python/client.py b/python/client.py index 6008765c..177ab1ed 100644 --- a/python/client.py +++ b/python/client.py @@ -1,8 +1,14 @@ import redis import tasks from pickle import loads, dumps +import socket + +hostname = socket.gethostname() +if hostname == 'debian': + q = redis.Redis(unix_socket_path='/var/run/redis/redis.sock') +elif hostname == 'gomez': + q = redis.Redis(host='debian') -q = redis.Redis() while True: f, args = loads(q.blpop("tasks")[1]) getattr(tasks, f)(*args) |
