Browse Source

Fix celery start command

Peter Justin 4 years ago
parent
commit
f31777ec00
4 changed files with 3 additions and 7 deletions
  1. 0 1
      celery_worker.py
  2. 1 1
      flaskbb/app.py
  3. 1 4
      flaskbb/cli/main.py
  4. 1 1
      requirements.txt

+ 0 - 1
celery_worker.py

@@ -11,7 +11,6 @@
     :copyright: (c) 2016 by the FlaskBB Team.
     :license: BSD, see LICENSE for more details.
 """
-import os
 from flaskbb.app import create_app
 from flaskbb.extensions import celery  # noqa
 

+ 1 - 1
flaskbb/app.py

@@ -132,9 +132,9 @@ def configure_app(app, config):
     old_celery_config = app.config.get_namespace('CELERY_')
     celery_config = {}
     for key, value in old_celery_config.items():
-        config_key = f"CELERY_{key.upper()}"
         # config is the new format
         if key != "config":
+            config_key = f"CELERY_{key.upper()}"
             celery_config[key] = value
             try:
                 del app.config[config_key]

+ 1 - 4
flaskbb/cli/main.py

@@ -18,7 +18,6 @@ from datetime import datetime
 
 import click
 import click_log
-from celery.bin.celery import CeleryCommand
 from flask import current_app
 from flask.cli import FlaskGroup, ScriptInfo, with_appcontext
 from flask_alembic import alembic_click
@@ -270,9 +269,7 @@ def upgrade(all_latest, fixture, force):
 @with_appcontext
 def start_celery(ctx):
     """Preconfigured wrapper around the 'celery' command."""
-    CeleryCommand(celery).execute_from_commandline(
-        ["flaskbb celery"] + ctx.args
-    )
+    celery.start(ctx.args)
 
 
 @flaskbb.command("shell", short_help="Runs a shell in the app context.")

+ 1 - 1
requirements.txt

@@ -4,7 +4,7 @@ attrs==20.3.0
 Babel==2.9.0
 billiard==3.6.3.0
 blinker==1.4
-celery==5.0.3
+celery==5.0.4
 certifi==2020.12.5
 chardet==3.0.4
 click==7.1.2