This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

celery workers

  • Loading branch information...
kennethreitz committed Mar 26, 2012
1 parent e5993ec commit 1c9ddae986c3bf8b07cfd5df7450e0016a00ac47
Showing with 11 additions and 2 deletions.
  1. +2 −1 Procfile
  2. +3 −1 manage.py
  3. +6 −0 springcreek/core.py
View
@@ -1 +1,2 @@
-web: gunicorn springcreek:app -b 0.0.0.0:$PORT -k gevent -w 4
+web: gunicorn springcreek:app -b 0.0.0.0:$PORT -k gevent -w 4
+celeryd: ./manage.py celeryd
View
@@ -2,11 +2,13 @@
# -*- coding: utf-8 -*-
from flaskext.script import Manager
+from flask.ext.celery import install_commands as install_celery
+
from springcreek import app
manager = Manager(app)
-
+install_celery(manager)
@manager.command
def hello():
View
@@ -7,16 +7,22 @@
from flask_googlefed import GoogleAuth
from flaskext.sqlalchemy import SQLAlchemy
from raven.contrib.flask import Sentry
+from flask.ext.celery import Celery
+
app = Flask(__name__)
app.secret_key = 'some-secret-key'
+# Use gevent workers for celery.
+app.config['CELERYD_POOL'] = 'gevent'
+
heroku = Heroku(app)
sentry = Sentry(app)
auth = GoogleAuth(app)
toolbar = DebugToolbarExtension(app)
db = SQLAlchemy(app)
+celery = Celery(app)
@app.route('/')

0 comments on commit 1c9ddae

Please sign in to comment.