From dbcd8e34652796871e16182c79dd013992fd16a4 Mon Sep 17 00:00:00 2001 From: Ed Summers Date: Thu, 20 Oct 2011 05:18:04 +0000 Subject: [PATCH] use redis in production environment for pub/sub instead of polling --- README.md | 2 +- core/tasks.py | 2 +- requirements.pip | 1 + settings/prod.py | 8 +++++--- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f6ccf2d8..27fdafcd 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Below are the steps for getting regluit running on EC2 with Apache and mod_wsgi, 1. create an ubuntu natty ec2 instance using ami-1aad5273 1. `sudo aptitude update` 1. `sudo aptitude upgrade` -1. `sudo aptitude install git apache libapache2-mod-wsgi mysql-client python-virtualenv python-mysqldb` +1. `sudo aptitude install git apache libapache2-mod-wsgi mysql-client python-virtualenv python-mysqldb redis-server` 1. `sudo mkdir /opt/regluit` 1. `sudo chown ubuntu:ubuntu /opt/regluit` 1. `cd /opt` diff --git a/core/tasks.py b/core/tasks.py index 7d47c9a3..692288ab 100644 --- a/core/tasks.py +++ b/core/tasks.py @@ -8,4 +8,4 @@ def add_related(isbn): @task def add_by_isbn(isbn): - bookloader.add_isbn(isbn) + bookloader.add_by_isbn(isbn) diff --git a/requirements.pip b/requirements.pip index 66730912..96c79058 100644 --- a/requirements.pip +++ b/requirements.pip @@ -11,3 +11,4 @@ nose django-profiles django-kombu django-celery +redis diff --git a/settings/prod.py b/settings/prod.py index 3e5b81be..58f16b01 100644 --- a/settings/prod.py +++ b/settings/prod.py @@ -70,6 +70,8 @@ PAYPAL_TEST_NONPROFIT_PARTNER_EMAIL = "" BASE_URL = 'http://0.0.0.0/' -# use database as queuing service in development -BROKER_TRANSPORT = "djkombu.transport.DatabaseTransport" -INSTALLED_APPS += ("djkombu",) +# use redis for production queue +BROKER_TRANSPORT = "redis" +BROKER_HOST = "localhost" +BROKER_PORT = 6379 +BROKER_VHOST = "0"