Merge "Change celery config to use sqlite backend messaging and results"
This commit is contained in:
commit
0e808a985d
4
.config
4
.config
@ -1,3 +1,5 @@
|
||||
redis: redis://localhost:6379/1
|
||||
|
||||
celery_broker: sqla+sqlite:////tmp/celery.db
|
||||
celery_backend: db+sqlite:////tmp/celery.db
|
||||
solar_db: sqlite:////tmp/solar.db
|
||||
# solar_db: riak://10.0.0.2:8087
|
||||
|
@ -8,8 +8,6 @@ jsonschema==2.4.0
|
||||
requests
|
||||
dictdiffer==0.4.0
|
||||
enum34==1.0.4
|
||||
redis==2.10.3
|
||||
fakeredis
|
||||
inflection
|
||||
Fabric==1.10.2
|
||||
tabulate==0.7.5
|
||||
@ -27,6 +25,8 @@ wrapt
|
||||
peewee
|
||||
# if you want to use lua computable inputs
|
||||
# lupa
|
||||
# required for celery sql backends
|
||||
sqlalchemy
|
||||
|
||||
|
||||
# if you want to use complex version check in repositories
|
||||
|
@ -23,7 +23,8 @@ import yaml
|
||||
CWD = os.getcwd()
|
||||
|
||||
C = Bunch(solar_db="")
|
||||
C.redis = 'redis://localhost:6379/1'
|
||||
C.celery_broker = 'sqla+sqlite:////tmp/celery.db'
|
||||
C.celery_backend = 'db+sqlite:////tmp/celery.db'
|
||||
|
||||
|
||||
def _lookup_vals(setter, config, prefix=None):
|
||||
|
@ -15,14 +15,11 @@
|
||||
from celery import Celery
|
||||
|
||||
from solar.config import C
|
||||
from solar.utils import parse_database_conn
|
||||
|
||||
conn, _ = parse_database_conn(C.redis)
|
||||
_url = 'redis://{}:{}/{}'.format(conn.host, conn.port, conn.database)
|
||||
|
||||
app = Celery(
|
||||
include=['solar.system_log.tasks', 'solar.orchestration.tasks'],
|
||||
backend=_url,
|
||||
broker=_url)
|
||||
broker=C.celery_broker,
|
||||
backend=C.celery_backend)
|
||||
app.conf.update(CELERY_ACCEPT_CONTENT=['json'])
|
||||
app.conf.update(CELERY_TASK_SERIALIZER='json')
|
||||
|
Loading…
Reference in New Issue
Block a user