Should be all that's needed to switch celery/kombu settings to sqlalchemy
authorChristopher Allan Webber <cwebber@dustycloud.org>
Sun, 26 Feb 2012 04:39:08 +0000 (22:39 -0600)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Sun, 26 Feb 2012 04:39:38 +0000 (22:39 -0600)
mediagoblin/config_spec.ini
mediagoblin/init/celery/__init__.py

index 2b4ba2f95ba131f4fb9308d8187d753a7b8e011a..1fd56226b47005a419db72f617fd4ea17568fe08 100644 (file)
@@ -79,6 +79,14 @@ lock_dir = string(default="%(here)s/user_dev/beaker/cache/lock")
 
 
 [celery]
+# default result stuff
+celery_result_backend = string(default="database")
+celery_result_dburi = string(default="sqlite://%(here)s/user_dev/celery.db")
+
+# default kombu stuff
+broker_transport = string(default="database")
+broker_host = string(default="sqlite://%(here)s/user_dev/celery.db")
+
 # known booleans
 celery_result_persistent = boolean()
 celery_create_missing_queues = boolean()
index fb958909ce000220f1fb7c88489fe421d32430ec..6dcea239c1166624b95c69b3bcd6463c4d550266 100644 (file)
@@ -47,30 +47,13 @@ def setup_celery_from_config(app_config, global_config,
 
     celery_settings = {}
 
-    # set up mongodb stuff
-    celery_settings['CELERY_RESULT_BACKEND'] = 'mongodb'
-    if 'BROKER_BACKEND' not in celery_settings:
-        celery_settings['BROKER_BACKEND'] = 'mongodb'
-
-    celery_mongo_settings = {}
-
-    if 'db_host' in app_config:
-        celery_mongo_settings['host'] = app_config['db_host']
-        if celery_settings['BROKER_BACKEND'] == 'mongodb':
-            celery_settings['BROKER_HOST'] = app_config['db_host']
-    if 'db_port' in app_config:
-        celery_mongo_settings['port'] = app_config['db_port']
-        if celery_settings['BROKER_BACKEND'] == 'mongodb':
-            celery_settings['BROKER_PORT'] = app_config['db_port']
-    celery_mongo_settings['database'] = app_config['db_name']
-
-    celery_settings['CELERY_MONGODB_BACKEND_SETTINGS'] = celery_mongo_settings
-
-    # Add anything else
+    # Add all celery settings from config
     for key, value in celery_conf.iteritems():
         key = key.upper()
         celery_settings[key] = value
 
+    # TODO: use default result stuff here if it exists
+
     # add mandatory celery imports
     celery_imports = celery_settings.setdefault('CELERY_IMPORTS', [])
     celery_imports.extend(MANDATORY_CELERY_IMPORTS)