Skip to content

Commit

Permalink
moving celery settings to settings.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Krishna Puttaswamy committed Oct 26, 2014
1 parent 8db0197 commit e902e54
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 4 additions & 1 deletion airflow/executors/celery_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
import logging
from celery import Celery

from airflow import settings

# to start the celery worker, run the command:
# "celery -A airflow.executors.celery_worker worker --loglevel=info"

app = Celery('airflow.executors.celery_worker', backend='amqp', broker='amqp://')
# app = Celery('airflow.executors.celery_worker', backend='amqp', broker='amqp://')
app = Celery(settings.CELERY_APP_NAME, backend=settings.CELERY_BROKER, broker=settings.CELERY_RESULTS_BACKEND)

@app.task (name='airflow.executors.celery_worker.execute_command')
def execute_command(command):
Expand Down
11 changes: 11 additions & 0 deletions airflow/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,14 @@
#engine = create_engine('mysql://airflow:airflow@localhost/airflow')
engine = create_engine('sqlite:///' + BASE_FOLDER + '/airflow.db' )
Session.configure(bind=engine)
HEADER = """\
.__ _____.__
_____ |__|_______/ ____\ | ______ _ __
\__ \ | \_ __ \ __\| | / _ \ \/ \/ /
/ __ \| || | \/| | | |_( <_> ) /
(____ /__||__| |__| |____/\____/ \/\_/
\/"""

CELERY_APP_NAME = "airflow.executors.celery_worker"
CELERY_BROKER = "amqp"
CELERY_RESULTS_BACKEND = "amqp://"

0 comments on commit e902e54

Please sign in to comment.